Scott Haneda wrote:
> I don't even know how to search this one out, excuse the basic
> #subNavlist li
> Can someone explain to me the difference in putting the html
> part you want before the css name, versus after:
No, that last one is incurrect.
> Its not at all making sense to me, I would think I would want
> to do li#subNavlist but that does not work.
The id or class is always *after* the elements name, as in
ul#subNavlist, or you can use it *without* the element's name, as
When you see an element's name after an id or class, as in
'#subNavlist li', there is a space between them, and it means the
second element is a child of the first one.
'ul#subNavlist li' means a <li> element, that is a child of a
<ul> element with id="subNavlist".
'#subNavlist li' means a <li> element, that is a child of any
element with id="subNavlist".
'ul#subNavlist' means a <ul> element with id="subNavlist".
'div.foo' means a <div> element with class="foo".
'.foo' means any element with class="foo".
'.foo div' means a <div> element which is a child of any element
If you're ever in doubt what a certain string of classes,
elements and or id's means, paste it into the Selectoracle for
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/