Posted By

xcsteve99 on 12/18/12


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

craig


CSS Pseudo Classes


 / Published in: CSS
 

URL: http://www.quirksmode.org/css/firstchild.html

The :first-child pseudo class means "if this element is the first child of its parent". :last-child means "if this element is the last child of its parent". Note that only element nodes (HTML tags) count, these pseudo-classes ignore text nodes.

  1. div#test p:first-child {text-decoration: underline;}
  2. div#test p:last-child {color: red;}

Report this snippet  

You need to login to post a comment.