On 8/15/07, Ken Snyder <[EMAIL PROTECTED]> wrote:
> So my firebug inspect css is telling me that "body :hover" is actually
> interpreted as "body *:hover".
>
> Weird that it works that way.  A case where nothing (empty string) is
> the same as everything (asterisk)! Philosophize that!
>

if you have an element:

<div id="foo" class="bar" />

you can select it with any of the following:

div
div#foo
div#foo.bar
div.bar
#foo
#foo.bar
.bar

the last three really mean:

#foo = *#foo (or, any element type whose id is foo)
#foo.bar = *#foo.bar (or, any element type whose id is foo and whose
class is bar)
.bar = *.bar (or, any element type, with any id, whose class is bar)

on the same token, you can use:

div#foo.bar:hover
div#foo:hover
div:hover
#foo.bar:hover
#foo:hover
.bar:hover

and most interesting,

:hover

you can take any of the pieces off of the full css selector
(div#foo.bar:hover) and it will magically replace that piece with a *.
that's why it cascades :-)

i don't know if that made any sense at all, but that's how it works...

justin
-- 
http://justinhileman.com

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to