{"id":2083,"date":"2013-12-25T21:51:56","date_gmt":"2013-12-25T13:51:56","guid":{"rendered":"https:\/\/blog.rexdf.org\/?page_id=2083"},"modified":"2013-12-25T21:51:56","modified_gmt":"2013-12-25T13:51:56","slug":"css-selectors","status":"publish","type":"page","link":"https:\/\/blog.rexdf.org\/ja\/css-selectors\/","title":{"rendered":"CSS\u30bb\u30ec\u30af\u30bf"},"content":{"rendered":"<div id=\"cnblogs_post_body\">\n<div>\n<p>\u6700\u8fd1\u5728\u7814\u7a76jQuery\u7684\u9009\u62e9\u5668\uff0c\u5927\u5bb6\u77e5\u9053jQuery\u7684\u9009\u62e9\u5668\u548ccss\u7684\u9009\u62e9\u5668\u975e\u5e38\u76f8\u4f3c\uff0c\u6240\u4ee5\u6574\u7406\u4e00\u4e0bcss\u9009\u62e9\u5668\uff1b<\/p>\n<p>css1-css3\u63d0\u4f9b\u975e\u5e38\u4e30\u5bcc\u7684\u9009\u62e9\u5668\uff0c\u4f46\u662f\u7531\u4e8e\u67d0\u4e9b\u9009\u62e9\u5668\u88ab\u5404\u4e2a\u6d4f\u89c8\u5668\u652f\u6301\u7684\u60c5\u51b5\u4e0d\u4e00\u6837\uff0c\u6240\u4ee5\u5f88\u591a\u9009\u62e9\u5668\u5728\u5b9e\u9645css\u5f00\u53d1\u4e2d\u5f88\u5c11\u7528\u5230\u3002<\/p>\n<h3>1.\u57fa\u7840\u7684\u9009\u62e9\u5668<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\n<p align=\"left\">\u9009\u62e9\u5668<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24%\">\n<p align=\"left\">*<\/p>\n<\/td>\n<td valign=\"top\" width=\"43%\">\n<p align=\"left\">\u901a\u7528\u5143\u7d20\u9009\u62e9\u5668\uff0c\u5339\u914d\u4efb\u4f55\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"32%\">\n<p align=\"left\">* { margin:0; padding:0; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24%\">\n<p align=\"left\">E<\/p>\n<\/td>\n<td valign=\"top\" width=\"43%\">\n<p align=\"left\">\u6807\u7b7e\u9009\u62e9\u5668\uff0c\u5339\u914d\u6240\u6709\u4f7f\u7528E\u6807\u7b7e\u7684\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"32%\">\n<p align=\"left\">p { font-size:2em; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24%\">\n<p align=\"left\">.info\u548cE.info<\/p>\n<\/td>\n<td valign=\"top\" width=\"43%\">\n<p align=\"left\">class\u9009\u62e9\u5668\uff0c\u5339\u914d\u6240\u6709class\u5c5e\u6027\u4e2d\u5305\u542binfo\u7684\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"32%\">\n<p align=\"left\">.info { background:#ff0; }<\/p>\n<p>p.info { background:#ff0; }<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24%\">\n<p align=\"left\">#info\u548cE#info<\/p>\n<\/td>\n<td valign=\"top\" width=\"43%\">\n<p align=\"left\">id\u9009\u62e9\u5668\uff0c\u5339\u914d\u6240\u6709id\u5c5e\u6027\u7b49\u4e8efooter\u7684\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"32%\">\n<p align=\"left\">#info { background:#ff0; }<\/p>\n<p>p#info { background:#ff0; }<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><\/h3>\n<h3>2.\u7ec4\u5408\u9009\u62e9\u5668<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E,F<\/p>\n<\/td>\n<td valign=\"top\" width=\"440\">\n<p align=\"left\">\u591a\u5143\u7d20\u9009\u62e9\u5668\uff0c\u540c\u65f6\u5339\u914d\u6240\u6709E\u5143\u7d20\u6216F\u5143\u7d20\uff0cE\u548cF\u4e4b\u95f4\u7528\u9017\u53f7\u5206\u9694<\/p>\n<\/td>\n<td valign=\"top\" width=\"255\">\n<p align=\"left\">Div,p { color:#f00; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E F<\/p>\n<\/td>\n<td valign=\"top\" width=\"440\">\n<p align=\"left\">\u540e\u4ee3\u5143\u7d20\u9009\u62e9\u5668\uff0c\u5339\u914d\u6240\u6709\u5c5e\u4e8eE\u5143\u7d20\u540e\u4ee3\u7684F\u5143\u7d20\uff0cE\u548cF\u4e4b\u95f4\u7528\u7a7a\u683c\u5206\u9694<\/p>\n<\/td>\n<td valign=\"top\" width=\"255\">\n<p align=\"left\">#nav li { display:inline; }<\/p>\n<p>li a { font-weight:bold; }<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E &gt; F<\/p>\n<\/td>\n<td valign=\"top\" width=\"440\">\n<p align=\"left\">\u5b50\u5143\u7d20\u9009\u62e9\u5668\uff0c\u5339\u914d\u6240\u6709E\u5143\u7d20\u7684\u5b50\u5143\u7d20F<\/p>\n<\/td>\n<td valign=\"top\" width=\"255\">\n<p align=\"left\">div &gt; strong { color:#f00; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E + F<\/p>\n<\/td>\n<td valign=\"top\" width=\"440\">\n<p align=\"left\">\u6bd7\u90bb\u5143\u7d20\u9009\u62e9\u5668\uff0c\u5339\u914d\u6240\u6709\u7d27\u968fE\u5143\u7d20\u4e4b\u540e\u7684\u540c\u7ea7\u5143\u7d20F<\/p>\n<\/td>\n<td valign=\"top\" width=\"255\">\n<p align=\"left\">p + p { color:#f00; }<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>3.CSS 2.1 \u5c5e\u6027\u9009\u62e9\u5668<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E[att]<\/p>\n<\/td>\n<td valign=\"top\" width=\"439\">\n<p align=\"left\">\u5339\u914d\u6240\u6709\u5177\u6709att\u5c5e\u6027\u7684E\u5143\u7d20\uff0c\u4e0d\u8003\u8651\u5b83\u7684\u503c\u3002\uff08\u6ce8\u610f\uff1aE\u5728\u6b64\u5904\u53ef\u4ee5\u7701\u7565\uff0c\u6bd4\u5982\u201c[cheacked]\u201d\u3002\u4ee5\u4e0b\u540c\u3002\uff09<\/p>\n<\/td>\n<td valign=\"top\" width=\"272\">\n<p align=\"left\">p[title] { color:#f00; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E[att=val]<\/p>\n<\/td>\n<td valign=\"top\" width=\"439\">\n<p align=\"left\">\u5339\u914d\u6240\u6709att\u5c5e\u6027\u7b49\u4e8e\u201cval\u201d\u7684E\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"272\">\n<p align=\"left\">div[class=\u201derror\u201d] { color:#f00; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E[att~=val]<\/p>\n<\/td>\n<td valign=\"top\" width=\"439\">\n<p align=\"left\">\u5339\u914d\u6240\u6709att\u5c5e\u6027\u5177\u6709\u591a\u4e2a\u7a7a\u683c\u5206\u9694\u7684\u503c\u3001\u5176\u4e2d\u4e00\u4e2a\u503c\u7b49\u4e8e\u201cval\u201d\u7684E\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"272\">\n<p align=\"left\">td[class~=\u201dname\u201d] { color:#f00; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E[att|=val]<\/p>\n<\/td>\n<td valign=\"top\" width=\"439\">\n<p align=\"left\">\u5339\u914d\u6240\u6709att\u5c5e\u6027\u5177\u6709\u591a\u4e2a\u8fde\u5b57\u53f7\u5206\u9694\uff08hyphen-separated\uff09\u7684\u503c\u3001\u5176\u4e2d\u4e00\u4e2a\u503c\u4ee5\u201cval\u201d\u5f00\u5934\u7684E\u5143\u7d20\uff0c\u4e3b\u8981\u7528\u4e8elang\u5c5e\u6027\uff0c\u6bd4\u5982\u201cen\u201d\u3001\u201cen-us\u201d\u3001\u201cen-gb\u201d\u7b49\u7b49<\/p>\n<\/td>\n<td valign=\"top\" width=\"272\">\n<p align=\"left\">p[lang|=en] { color:#f00; }<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u6ce8\uff1aCSS 2.1 <\/strong><strong>\u5c5e\u6027\u9009\u62e9\u5668\u8fd8\u6709\u4e00\u4e2a\u7279\u70b9\u5c31\u662f\u4f7f\u7528\u591a\u4e2a\u9009\u62e9\u5668\uff0c\u540c\u4e8b\u6ee1\u8db3\u8fd9\u591a\u4e2a\u9009\u62e9\u5668\uff1a<\/strong>blockquote[class=quote][cite] { color:#f00; }<\/p>\n<h3>4.CSS 2.1 \u4e2d\u7684\u4f2a\u7c7b<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:first-child<\/p>\n<\/td>\n<td valign=\"top\" width=\"388\">\n<p align=\"left\">\u5339\u914d\u7236\u5143\u7d20\u7684\u7b2c\u4e00\u4e2a\u5b50\u5143\u7d20<\/p>\n<\/td>\n<td rowspan=\"7\" valign=\"top\" width=\"274\">\n<p align=\"left\">p:first-child { font-style:italic; }<\/p>\n<p>input[type=text]:focus { color:#000; background:#ffe; }<\/p>\n<p>input[type=text]:focus:hover { background:#fff; }<\/p>\n<p>q:lang(sv) { quotes: \u201c\\201D\u201d \u201c\\201D\u201d \u201c\\2019\u2033 \u201c\\2019\u2033; }<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:link<\/p>\n<\/td>\n<td valign=\"top\" width=\"388\">\n<p align=\"left\">\u5339\u914d\u6240\u6709\u672a\u88ab\u70b9\u51fb\u7684\u94fe\u63a5<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:visited<\/p>\n<\/td>\n<td valign=\"top\" width=\"388\">\n<p align=\"left\">\u5339\u914d\u6240\u6709\u5df2\u88ab\u70b9\u51fb\u7684\u94fe\u63a5<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:active<\/p>\n<\/td>\n<td valign=\"top\" width=\"388\">\n<p align=\"left\">\u5339\u914d\u9f20\u6807\u5df2\u7ecf\u5176\u4e0a\u6309\u4e0b\u3001\u8fd8\u6ca1\u6709\u91ca\u653e\u7684E\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:hover<\/p>\n<\/td>\n<td valign=\"top\" width=\"388\">\n<p align=\"left\">\u5339\u914d\u9f20\u6807\u60ac\u505c\u5176\u4e0a\u7684E\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:focus<\/p>\n<\/td>\n<td valign=\"top\" width=\"388\">\n<p align=\"left\">\u5339\u914d\u83b7\u5f97\u5f53\u524d\u7126\u70b9\u7684E\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:lang(c)<\/p>\n<\/td>\n<td valign=\"top\" width=\"388\">\n<p align=\"left\">\u5339\u914dlang\u5c5e\u6027\u7b49\u4e8ec\u7684E\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>5.CSS 2.1\u4e2d\u7684\u4f2a\u5143\u7d20<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:first-line<\/p>\n<\/td>\n<td valign=\"top\" width=\"303\">\n<p align=\"left\">\u5339\u914dE\u5143\u7d20\u7684\u7b2c\u4e00\u884c<\/p>\n<\/td>\n<td rowspan=\"4\" valign=\"top\" width=\"274\">\n<p align=\"left\">p:first-line { font-weight:bold; color;#600; }<\/p>\n<p>.preamble:first-letter { font-size:1.5em; font-weight:bold; }<\/p>\n<p>.cbb:before { content:\u201d&#8221;; display:block; height:17px; width:18px; background:url(top.png) no-repeat 0 0; margin:0 0 0 -18px; }<\/p>\n<p>a:link:after { content: \u201d (\u201d attr(href) \u201c) \u201c; }<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:first-letter<\/p>\n<\/td>\n<td valign=\"top\" width=\"303\">\n<p align=\"left\">\u5339\u914dE\u5143\u7d20\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:before<\/p>\n<\/td>\n<td valign=\"top\" width=\"303\">\n<p align=\"left\">\u5728E\u5143\u7d20\u4e4b\u524d\u63d2\u5165\u751f\u6210\u7684\u5185\u5bb9<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:after<\/p>\n<\/td>\n<td valign=\"top\" width=\"303\">\n<p align=\"left\">\u5728E\u5143\u7d20\u4e4b\u540e\u63d2\u5165\u751f\u6210\u7684\u5185\u5bb9<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>6.CSS 3\u7684\u540c\u7ea7\u5143\u7d20\u901a\u7528\u9009\u62e9\u5668<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\n<p align=\"left\">\u9009\u62e9\u5668<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E ~ F<\/p>\n<\/td>\n<td valign=\"top\" width=\"398\">\n<p align=\"left\">\u5339\u914d\u4efb\u4f55\u5728E\u5143\u7d20\u4e4b\u540e\u7684\u540c\u7ea7F\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"211\">\n<p align=\"left\">p ~ ul { background:#ff0; }<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>7\uff0eCSS 3 \u5c5e\u6027\u9009\u62e9\u5668<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E[att^=\u201dval\u201d]<\/p>\n<\/td>\n<td valign=\"top\" width=\"290\">\n<p align=\"left\">\u5c5e\u6027att\u7684\u503c\u4ee5\u201dval\u201d\u5f00\u5934\u7684\u5143\u7d20<\/p>\n<\/td>\n<td rowspan=\"3\" valign=\"top\" width=\"223\">\n<p align=\"left\">div[id^=&#8221;nav&#8221;] { background:#ff0; }<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E[att$=\u201dval\u201d]<\/p>\n<\/td>\n<td valign=\"top\" width=\"290\">\n<p align=\"left\">\u5c5e\u6027att\u7684\u503c\u4ee5\u201dval\u201d\u7ed3\u5c3e\u7684\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E[att*=\u201dval\u201d]<\/p>\n<\/td>\n<td valign=\"top\" width=\"290\">\n<p align=\"left\">\u5c5e\u6027att\u7684\u503c\u5305\u542b\u201dval\u201d\u5b57\u7b26\u4e32\u7684\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>8. CSS 3\u4e2d\u4e0e\u7528\u6237\u754c\u9762\u6709\u5173\u7684\u4f2a\u7c7b<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:enabled<\/p>\n<\/td>\n<td valign=\"top\" width=\"367\">\n<p align=\"left\">\u5339\u914d\u8868\u5355\u4e2d\u6fc0\u6d3b\u7684\u5143\u7d20<\/p>\n<\/td>\n<td rowspan=\"4\" valign=\"top\" width=\"287\">\n<p align=\"left\">input[type=&#8221;text&#8221;]:disabled { background:#ddd;}<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:disabled<\/p>\n<\/td>\n<td valign=\"top\" width=\"367\">\n<p align=\"left\">\u5339\u914d\u8868\u5355\u4e2d\u7981\u7528\u7684\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:checked<\/p>\n<\/td>\n<td valign=\"top\" width=\"367\">\n<p align=\"left\">\u5339\u914d\u8868\u5355\u4e2d\u88ab\u9009\u4e2d\u7684radio\uff08\u5355\u9009\u6846\uff09\u6216checkbox\uff08\u590d\u9009\u6846\uff09\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E::selection<\/p>\n<\/td>\n<td valign=\"top\" width=\"367\">\n<p align=\"left\">\u5339\u914d\u7528\u6237\u5f53\u524d\u9009\u4e2d\u7684\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>9. CSS 3\u4e2d\u7684\u7ed3\u6784\u6027\u4f2a\u7c7b<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:root<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u6587\u6863\u7684\u6839\u5143\u7d20\uff0c\u5bf9\u4e8eHTML\u6587\u6863\uff0c\u5c31\u662fHTML\u5143\u7d20<\/p>\n<\/td>\n<td rowspan=\"11\" valign=\"top\" width=\"252\">\n<p align=\"left\">p:nth-child(3) { color:#f00; }<\/p>\n<p>p:nth-child(odd) { color:#f00; }<\/p>\n<p>p:nth-child(even) { color:#f00; }<\/p>\n<p>p:nth-child(3n+0) { color:#f00; }<\/p>\n<p>p:nth-child(3n) { color:#f00; }<\/p>\n<p>tr:nth-child(2n+11) { background:#ff0; }<\/p>\n<p>tr:nth-last-child(2) { background:#ff0; }<\/p>\n<p>p:last-child { background:#ff0; }<\/p>\n<p>p:only-child { background:#ff0; }<\/p>\n<p>p:empty { background:#ff0; }<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:nth-child(n)<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u5176\u7236\u5143\u7d20\u7684\u7b2cn\u4e2a\u5b50\u5143\u7d20\uff0c\u7b2c\u4e00\u4e2a\u7f16\u53f7\u4e3a1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:nth-last-child(n)<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u5176\u7236\u5143\u7d20\u7684\u5012\u6570\u7b2cn\u4e2a\u5b50\u5143\u7d20\uff0c\u7b2c\u4e00\u4e2a\u7f16\u53f7\u4e3a1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:nth-of-type(n)<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u4e0e:nth-child()\u4f5c\u7528\u7c7b\u4f3c\uff0c\u4f46\u662f\u4ec5\u5339\u914d\u4f7f\u7528\u540c\u79cd\u6807\u7b7e\u7684\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:nth-last-of-type(n)<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u4e0e:nth-last-child() \u4f5c\u7528\u7c7b\u4f3c\uff0c\u4f46\u662f\u4ec5\u5339\u914d\u4f7f\u7528\u540c\u79cd\u6807\u7b7e\u7684\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:last-child<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u7236\u5143\u7d20\u7684\u6700\u540e\u4e00\u4e2a\u5b50\u5143\u7d20\uff0c\u7b49\u540c\u4e8e:nth-last-child(1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:first-of-type<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u7236\u5143\u7d20\u4e0b\u4f7f\u7528\u540c\u79cd\u6807\u7b7e\u7684\u7b2c\u4e00\u4e2a\u5b50\u5143\u7d20\uff0c\u7b49\u540c\u4e8e:nth-of-type(1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:last-of-type<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u7236\u5143\u7d20\u4e0b\u4f7f\u7528\u540c\u79cd\u6807\u7b7e\u7684\u6700\u540e\u4e00\u4e2a\u5b50\u5143\u7d20\uff0c\u7b49\u540c\u4e8e:nth-last-of-type(1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:only-child<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u7236\u5143\u7d20\u4e0b\u4ec5\u6709\u7684\u4e00\u4e2a\u5b50\u5143\u7d20\uff0c\u7b49\u540c\u4e8e:first-child:last-child\u6216 :nth-child(1):nth-last-child(1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:only-of-type<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u7236\u5143\u7d20\u4e0b\u4f7f\u7528\u540c\u79cd\u6807\u7b7e\u7684\u552f\u4e00\u4e00\u4e2a\u5b50\u5143\u7d20\uff0c\u7b49\u540c\u4e8e:first-of-type:last-of-type\u6216 :nth-of-type(1):nth-last-of-type(1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:empty<\/p>\n<\/td>\n<td valign=\"top\" width=\"393\">\n<p align=\"left\">\u5339\u914d\u4e00\u4e2a\u4e0d\u5305\u542b\u4efb\u4f55\u5b50\u5143\u7d20\u7684\u5143\u7d20\uff0c\u6ce8\u610f\uff0c\u6587\u672c\u8282\u70b9\u4e5f\u88ab\u770b\u4f5c\u5b50\u5143\u7d20<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>10.CSS 3\u7684\u53cd\u9009\u4f2a\u7c7b<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u793a\u4f8b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:not(s)<\/p>\n<\/td>\n<td valign=\"top\" width=\"390\">\n<p align=\"left\">\u5339\u914d\u4e0d\u7b26\u5408\u5f53\u524d\u9009\u62e9\u5668\u7684\u4efb\u4f55\u5143\u7d20<\/p>\n<\/td>\n<td valign=\"top\" width=\"255\">\n<p align=\"left\">:not(p) { border:1px solid #ccc; }<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>11. CSS 3\u4e2d\u7684 :target \u4f2a\u7c7b<\/h3>\n<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20%\">\u9009\u62e9\u5668<\/td>\n<td valign=\"top\" width=\"40%\">\n<p align=\"left\">\u542b\u4e49<\/p>\n<\/td>\n<td valign=\"top\" width=\"40%\"><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<p align=\"left\">E:target<\/p>\n<\/td>\n<td valign=\"top\" width=\"417\">\n<p align=\"left\">\u5339\u914d\u6587\u6863\u4e2d\u7279\u5b9a\u201did\u201d\u70b9\u51fb\u540e\u7684\u6548\u679c<\/p>\n<\/td>\n<td valign=\"top\" width=\"161\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div id=\"_mcePaste\">CSS\u9009\u62e9\u5668\u6d4f\u89c8\u5668\u652f\u6301\u60c5\u51b5\uff0c\u5176\u4e2d\u5305\u62ec\u6700\u65b0\u7684CSS3\u548cSafari 4.0 Beta\u7684\u652f\u6301\u60c5\u51b5\u3002\u611f\u8c22Estelle Weyl\u7684\u603b\u7ed3\u3002<\/div>\n<div id=\"_mcePaste\">\u6ce8:<\/div>\n<div id=\"_mcePaste\">\u7eff\u8272 \/ \u221a \u00a0\u8868\u793a\u76ee\u524d\u652f\u6301\u3002<\/div>\n<div id=\"_mcePaste\">\u6a59\u8272\/ \u0394 \u00a0 \u8868\u793a\u6d4f\u89c8\u5668\u90e8\u5206\u652f\u6301\u5f53\u524dCSS\u9009\u62e9\u5668\u3002<\/div>\n<div id=\"_mcePaste\">\u7ea2\u8272\/ \u03a7 \u00a0 \u8868\u793a\u6d4f\u89c8\u5668\u5b8c\u5168\u4e0d\u652f\u6301\u3002<\/div>\n<p><strong>CSS\u9009\u62e9\u5668\u6d4f\u89c8\u5668\u652f\u6301\u60c5\u51b5<\/strong>\uff0c\u5176\u4e2d\u5305\u62ec\u6700\u65b0\u7684CSS3\u548cSafari 4.0 Beta\u7684\u652f\u6301\u60c5\u51b5\u3002\u611f\u8c22<a href=\"http:\/\/www.evotech.net\/blog\/2009\/02\/css-browser-support\/\" target=\"_blank\">Estelle Weyl<\/a>\u7684\u603b\u7ed3\u3002<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u7814\u7a76jQuery\u7684\u9009\u62e9\u5668\uff0c\u5927\u5bb6\u77e5\u9053jQuery\u7684\u9009\u62e9\u5668\u548ccss\u7684\u9009\u62e9\u5668\u975e\u5e38 &hellip; <a href=\"https:\/\/blog.rexdf.org\/ja\/css-selectors\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2083","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/pages\/2083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/comments?post=2083"}],"version-history":[{"count":0,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/pages\/2083\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/media?parent=2083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}