CSS3 学习笔记
[ 2007-08-24 01:28:18 | Author: 星辉一冷 ]
选择符 | Selectors
*
匹配任何元素
E
匹配E元素
E[foo]
匹配包含foo属性的E元素
E[foo="bar"]
匹配foo属性值为bar的E元素
E[foo~="list"]
匹配包含foo属性且值在list中的元素(list中的值用空格隔开)
例如: p[class~=style1 style2 ...] 将匹配所有class为style1, style2, ...的p元素.
E[foo^="bar"]
匹配foo属性值以bar开头的E元素, 如: <E foo="bar_menu">
E[foo$="bar"]
匹配foo属性值以bar结尾的E元素, 如: <E foo="menubar">
E[foo*="bar"]
匹配foo属性值包含有bar的E元素, 如: <E foo="abarberman">
E[hreflang|="en"]
匹配hreflang属性值不为en的E元素, 如: <E hreflang="cn">
E:root
匹配E元素的root元素.
E:nth-child(n)
E:nth-last-child(n)
E:nth-of-type(n)
E:nth-of-type(n)
E:first-child
E:last-child
E:first-of-type
E:last-of-type
E:only-child
E:only-of-type
E:empty
E:link
E:visited
E:active
E:hover
E:focus
E:target
E:lang(fr)
E:enabled
E:disabled
E:checked
E::first-line
E::first-letter
E::selection
E::before
E::after
E.warning
E#myid
E:not(s)
E F
E > F
E + F
E ~ F
Comment Feed: http://www.dreammx.com/xhyl/feed.asp?q=comment&id=395
Trackback URL: http://www.dreammx.com/xhyl/trackback.asp?id=395&key=xhyl
*
匹配任何元素
E
匹配E元素
E[foo]
匹配包含foo属性的E元素
E[foo="bar"]
匹配foo属性值为bar的E元素
E[foo~="list"]
匹配包含foo属性且值在list中的元素(list中的值用空格隔开)
例如: p[class~=style1 style2 ...] 将匹配所有class为style1, style2, ...的p元素.
E[foo^="bar"]
匹配foo属性值以bar开头的E元素, 如: <E foo="bar_menu">
E[foo$="bar"]
匹配foo属性值以bar结尾的E元素, 如: <E foo="menubar">
E[foo*="bar"]
匹配foo属性值包含有bar的E元素, 如: <E foo="abarberman">
E[hreflang|="en"]
匹配hreflang属性值不为en的E元素, 如: <E hreflang="cn">
E:root
匹配E元素的root元素.
E:nth-child(n)
E:nth-last-child(n)
E:nth-of-type(n)
E:nth-of-type(n)
E:first-child
E:last-child
E:first-of-type
E:last-of-type
E:only-child
E:only-of-type
E:empty
E:link
E:visited
E:active
E:hover
E:focus
E:target
E:lang(fr)
E:enabled
E:disabled
E:checked
E::first-line
E::first-letter
E::selection
E::before
E::after
E.warning
E#myid
E:not(s)
E F
E > F
E + F
E ~ F
Comment Feed: http://www.dreammx.com/xhyl/feed.asp?q=comment&id=395
Trackback URL: http://www.dreammx.com/xhyl/trackback.asp?id=395&key=xhyl