On 10/10/06, Jørgen Farum Jensen <[EMAIL PROTECTED]> wrote:
> Is there any difference at all between
> * #leftcol {font-family:arial,sans-serif;}
> #leftcol * {font-family:arial,sans-serif;}
The first one is equivalent to this version, with no * at all:
#leftcol {font-family: arial, sans-serif; }
It just says that the element whose id is "leftcol", no matter what
type of element it is, should have its font-family set as indicated.
The second one:
#leftcol * {font-family: arial, sans-serif; }
Does not touch the element whose id is "leftcol" at all. Rather, it
sets the font on its *children*.
Here's a concrete example of the difference. Given this CSS:
html, body { font-family: serif; }
#leftcol { font-family: arial, sans-serif; }
This HTML would render as it describes itself:
<h1>Serifs Here</h1>
<div id="leftcol">
No more serifs
<p id="leftcol">No serifs in here, either</p>
Still sans-serif.
</div>
<p>But now the serifs are back</p>.
But with the CSS changed to this:
html, body { font-family: serif; }
#leftcol * { font-family: arial, sans-serif; }
You get this instead:
<h1>Serifs Here</h1>
<div id="leftcol">
And still serifs here!
<p id="leftcol">No serifs in here, though</p>
Back to being serifed.
</div>
Because the style in the #leftcol * selector gets applied to the p
inside the div, but not the div itself.
--
Mark J. Reed <[EMAIL PROTECTED]>
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/