Scripsit
Join Bytes!:
Quote:
I am learning CSS and other WWW technologies.
|
You clearly need a better tutorial than the one you have read.
Quote:
In the folowing
definition italic doesn't work:
>
h2
{
color: Brown;
text-decoration: italic;
}
|
Of course it does not work, since italic is not an allowed value for
text-decoration. The checker
http://jigsaw.w3.org/css-validator/
(recommended by _any_ decent tutorial or textbook on CSS these days)
would have told this immediately.
Moreover, the checker would have told you that Brown is not a defined
color value. Though recognized by most browsers, it does not belong to
any CSS specification. Use numeric color values instead.
If you fix this and select "More Options" in the checker's user
interface, then select "All" from the "Warnings" menu - as you should,
especially if you are a novice, or an advanced CSS author, or a CSS
guru - then the checker additionally informs you:
"You have no background-color set (or background-color is set to
transparent) but you have set a color. Make sure that cascading of
colors keeps the text reasonably legible."
The second sentence there is somewhat pointless and obscure. (For
example, colors don't cascade.) It should read: if you set color for an
element, set background properties for it, too, and vice versa. (Using
sufficient color contrast, but that's a different issue.)
The way to declare that italics be used is
font-style: italic
but there are several things to note:
1) Browsers don't make a distinction between italic and oblique.
Whichever you declare, you get an italic or oblique version of the font,
if available, and fake oblique (normal font slanted) otherwise.
2) Italics should normally be used with serif fonts only, so in
practice, you should set font-family whenever you set font-style:
italic.
3) Italics does not work well with large-size bold text, and headings
usually appear that way by default.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/