> "The :first-child pseudo-class represents an element that is the first
> child of some other element.".
>
> I have often used li:first-child or li a:first child in different
> section of a page, why is that I can get the first-child in, say,
>
> #hdr li:first-child
> .sidebox li:first-child (and it applies to all sidebox sections)
>
> .sidebox li ol:first-child, #content h2:first-child
>
> In a typical 2 columns layout, in content area, there are a number of
> h2 in different sections and there is no first-child declared but h2,
> but I can never get h2:first-child works yet #hdr li:first-child and
> .sidebox li:first-child work. This is still a bit confusing, is that
> means #hdr li:first-child (which is not wrapped inside #content)
> considers the first child of some other element for the entire page? If
> yes, why is that the ".sidebox li ol:first-child" and ".sidebox
> li:first-child" still work?
Can you style the h2 using #content > h2 {} (to confirm that these headings
*are* children of #content)
If that works then go with: #content > h2:first-child {}
--
Regards,
Thierry
@thierrykoblentz
www.tjkdesign.com | www.ez-css.org | www.css-101.org
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [email protected]
*******************************************************************