2009年3月29日星期日

CSS Hack for Google Chrome and Safari 3.1

Posted by admin | Filed under css/xhtml

1. body:nth-of-type(1) p{
2. color: #333333;
3. }


E:nth-of-type(n)
Selects the element E that is the nth sibling amongst its peers of the same type within their parent. Similar to E:nth-child(n) above, though instead of simply selecting the nth element of some parent, you are now selecting the nth element of a particular type. Example:

1. ul li:nth-of-type(1) /*selects the first LI of every UL on the page, including nested ULs*/
2. p:nth-of-type(odd) /*selects all ODD paragraphs on the page*/

没有评论:

发表评论