On 06/03/11 20:22, tee wrote:
but I can never get h2:first-child works

Here's an example, specifically using h2 elements since you mentioned them:

http://www.boogdesign.com/examples/css3/first-child.html

By default, every element has a blue border, but any element which is a :first-child has a red border:

:first-child {
    border: 1px solid red;
}

In addition, h2 elements which are children of #content and first-child within their parent have white text on a black background:

#content h2:first-child {
    color: #fff;
    background: #000;
}

Rob


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*******************************************************************

Reply via email to