Matthias Pospiech <> wrote:
> I define a class url
> .url
> {
> display: ??;
> color: #606060;
> }
You should always specify background whenever you specify color.
What if the user's style sheet contains
* { background: #606060; color: black; }
?
> <li>
> <a href="http://www.tug.org/interest.html">TeX Resources on the
> Web</a> <span
> class="url">http://www.tug.org/interest.html</span></li>
>
> now I want the span to be a block, ie. to break in to the next line if
> the url does not fit into the current one.
That's not what "block" means. A block unconditionally begins on a new line
(unless you do something else explicitly).
> What kind of value for display is the correct on in that case ?
The value inline, which is the default value, so it need not be specified.
Toby's suggestion of using white-space: nowrap might be what you are after.
Contrary to its name - CSS property names are often misleading - it
prevents line breaks inside the content, except for explicitly created
breaks (e.g., <br>). Thus it may prevent a browser from splitting after "/"
for example. Whether this is a good thing to do is a different issue.
Normally URLs should appear as attribute values, not in document content
proper. Have you ever listened to a speech browser reading URLs? It doesn't
actually improve the experience. It's sufficient to have the link there.
If you wish to include a URL for _printed_ copies, then again this might
not be a good idea. The URL of the page itself is usually sufficient and
can be included into the printed copy by the user if desired, and many
browsers can automatically generate a list of URLs appearing in links.
But if you do include a URL into document content proper, I would recommend
using quotation marks or the characters "<" and ">" as delimiters and
encourage (rather than discourage) browsers into splitting a URL across
lines, as described in more detail at
http://www.cs.tut.fi/~jkorpela/html/nobr.html#url
--
Yucca,
http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring:
http://www.cs.tut.fi/~jkorpela/www.html