CSS3新增伪类

p:last-of-type         选择其父元素的最后的一个P元素spa

p:last-child            选择其父元素的最后子元素(必定是P才行)input

 

p:first-of-type        选择其父元素的首个P元素ast

p:first-child           选择其父元素的首个p元素(必定是p才行)ab

 

p:only-child    选择其父元素的只有一个元素(并且这个元素只能是p元素,不能有其余元素)

p:only-of-type   选择其父元素的只有一个p元素(不能有第二个P元素,其余元素能够有) 

 

选第N个

p:nth-child(n)      选择其父元素的第N个 恰好是p的元素

p:nth-last-child(n)    ..............................................从最后一个子元素开始计数

p:nth-of-type(n)   选择其父元素的n个元素

p:nth-last-of-type(n)   ........................从最后一个子元素开始计数

 

 

用在input上

:enabled

:

相关文章
相关标签/搜索