From: "Paolo Candelari" <[EMAIL PROTECTED]>
>Who can explain why I see italic and not bolded text instead of bold and
>normal (not italic) text, with these rules:
>
>#main #content * {font-size: 24px;
> font-style: italic;
>}
>#main #content span {display: block;
> margin: 24px 0;
> font: bold normal;
>}
>I have this HTML srtucture:
>
><div id="content">
><p>text <span>text</span> text <span>text</span> text</p>
></div>
>
>In theory, second font rule, though it's in short form, comes as second in
>the cascade and it have more specificity because of declaration of span
>element against * (universal selector) ... or not?
>
>To see bold and normal text I have to write specific rules:
>
>#main #content span {display: block;
> margin: 24px 0;
> font-weight: bold;
> font-style: normal;
>}
Paolo,
Your logic for the specificity seems, well, logical, but I see the problem
similarly to Georg's conclusion, that the font selector is, after a fashion,
incomplete.
The specs indicate that we can eliminate some of the properties when specifying
font, and initial values of those /not/ given will be set to default values, in
the absence of other specific property declarations.
However, in brief tests, it appears that font-size is a trigger for applying
those re-declared properties. As long as a font-size is given, and it is /not/
the last property specified in the font shorthand, then the changes you want
will be applied. Without a font-size, no changes, no matter how many of the
other properties I specified, were made.
While I could find no indication of this font-size requirement in the specs
(not that it isn't there, I just didn't find anything), the three browsers I
tested in reacted similarly.
At least retyping the font-size is fewer keystrokes than repeating the two
other properties in their entirety to accomplish what you want.
I hope that helps,
~holly
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/