第十六节:CSS3选择器之:结构性伪类E:nth-of-type

语法
E:nth-of-type(n) : {attribute}
相关伪类:E:root | E:nth-child | E:nth-last-child | E:nth-last-of-type | E:last-child | E:first-of-type | E:only-child | E:only-of-type | E:empty

说明
匹配同类型中的第n个同级兄弟元素E

兼容性
Firefox3.5,Chrome1.0,Chrome2.0,Opera9.63,Safari3.1,Safari 4Public beta

代码示例
<style type="text/css">
p:nth-of-type(3) {color:#FF0000;}
</style>
<div style="width:733px; border: 1px solid #666; padding:5px;">
    <p>匹配父元素中的第n个子元素E,这里的字的颜色是黑色的</p>
    <p>匹配父元素中的第n个子元素E,这里的字的颜色也是黑色的</p>
    <p>匹配父元素中的第n个子元素E,这里的字的颜色也是红色的</p>
    <p>匹配父元素中的第n个子元素E,这里的字的颜色同样也是黑色的</p>
</div>