{"id":4514,"date":"2021-05-07T10:54:03","date_gmt":"2021-05-07T02:54:03","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=4514"},"modified":"2021-05-07T10:54:03","modified_gmt":"2021-05-07T02:54:03","slug":"%e7%ba%afcss%e6%96%87%e7%ab%a0%e5%88%97%e8%a1%a8%e9%9a%94%e8%a1%8c%e6%8d%a2%e8%89%b2%ef%bc%8c%e9%9a%94%e8%a1%8c%e6%8d%a2%e6%a0%b7%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/4514.html","title":{"rendered":"\u7eafCSS\u6587\u7ae0\u5217\u8868\u9694\u884c\u6362\u8272\uff0c\u9694\u884c\u6362\u6837\u5f0f"},"content":{"rendered":"

\u7eafCSS\u6587\u7ae0\u5217\u8868\u9694\u884c\u6362\u8272<\/p>\n

\u5148\u770b\u770b\u6548\u679c\uff1a<\/p>\n

\"\"<\/a><\/p>\n

\u9694\u56db\u884c\u6362\u8272<\/p>\n

\"\"<\/a><\/p>\n

\u5176\u4ed6\u6837\u5f0f\u53ef\u81ea\u884c\u4fee\u6539\u3002\u6bd4\u5982\u9694\u884c\u52a0\u7c97\uff0c\u5b57\u4f53\u53d8\u5927\u7b49\u3002<\/p>\n

CSS\u6837\u5f0f\uff1a<\/p>\n

#list1 li:nth-of-type(odd){ background:#00ccff;}\u5947\u6570\u884c \r\n#list1 li:nth-of-type(even){ background:#ffcc00;}\u5076\u6570\u884c \r\n#list2 li:nth-child(4n+1){ background:#00ccff;}\u4ece\u7b2c\u4e00\u884c\u5f00\u59cb\u7b97\u8d77 \u6bcf\u96944\u4e2a\uff08\u5305\u542b\u7b2c\u56db\u4e2a\uff09\u4f7f\u7528\u6b64\u6837\u5f0f \r\n#list00000 li:nth-child(4n+2){background:#090;}\u4ece\u7b2c\u4e8c\u884c\u5f00\u59cb\u7b97\u8d77 \u6bcf\u96944\u4e2a\uff08\u5305\u542b\u7b2c\u56db\u4e2a\uff09\u4f7f\u7528\u6b21\u6837\u5f0f \r\n#list00000 li:nth-child(4n+3){background:#009;}\u4ece\u7b2c\u4e09\u884c\u5f00\u59cb\u7b97\u8d77 \u6bcf\u96944\u4e2a\uff08\u5305\u542b\u7b2c\u56db\u4e2a\uff09\u4f7f\u7528\u6b21\u6837\u5f0f \r\n#list00000 li:nth-child(4n+4){background:#990;}\u4ece\u7b2c\u56db\u884c\u5f00\u59cb\u7b97\u8d77 \u6bcf\u96944\u4e2a\uff08\u5305\u542b\u7b2c\u56db\u4e2a\uff09\u4f7f\u7528\u6b21\u6837\u5f0f<\/code><\/pre>\n

HTML\u4ee3\u7801\uff1a<\/p>\n

<ul id=\"list1\"> \r\n<li>\u8bfb\u4e66\u4e4b\u4e50\u4e50\u65e0\u7a77\uff0c\u62e8\u7434\u4e00\u5f04\u6765\u718f\u98ce\u3002<\/li> \r\n<li>\u4e66\u591a\u7b14\u6e10\u91cd\uff0c\u7761\u5c11\u6795\u957f\u65b0\u3002\u2014\u2014\u59da\u5408\u300a\u522b\u8d3e\u5c9b\u300b<\/li> \r\n<li>\u574f\u4e66\u662f\u5e26\u6709\u77e5\u8bc6\u6027\u7684\u6bd2\u836f\uff0c\u5b83\u4f1a\u6bd2\u6740\u7cbe\u795e\u3002\u2014\u2014\u4f0f\u5c14\u6cf0<\/li> \r\n<li>\u80f8\u4e2d\u4e66\u4f20\u6709\u4f59\u9999\u3002\u2014\u2014\u5b8b\u00b7\u8f9b\u5f03\u75be<\/li> \r\n<li>\u9759\u5750\u81ea\u65e0\u5984\u4e3a\uff0c\u8bfb\u4e66\u5373\u662f\u7acb\u5fb7\u3002<\/li> \r\n<li>\u8981\u77e5\u5929\u4e0b\u4e8b\uff0c\u987b\u8bfb\u53e4\u4eba\u4e66\u3002<\/li> \r\n<li>\u51e1\u4e8b\u8c6b\u5219\u7acb\uff0c\u4e0d\u8c6b\u5219\u5e9f\u3002<\/li> \r\n<li>\u5b66\u800c\u4e0d\u601d\u5219\u7f54\uff0c\u601d\u800c\u4e0d\u5b66\u5219\u6b86\u3002<\/li> \r\n<li>\u5b66\u800c\u65f6\u4e60\u4e4b\uff0c\u4e0d\u4ea6\u8bf4\u4e4e\uff1f<\/li> \r\n<li>\u541b\u5b50\u5766\u8361\u8361\uff0c\u5c0f\u4eba\u5e38\u621a\u621a\u3002<\/li> \r\n<li>\u53d1\u6124\u5fd8\u98df\uff0c\u4e50\u4ee5\u5fd8\u5fe7\uff0c\u4e0d\u77e5\u8001\u4e4b\u5c06\u81f3\u4e91\u5c14\u3002<\/li> \r\n<li>\u5de7\u8a00\u4e71\u5fb7\uff0c\u5c0f\u4e0d\u5fcd\u5219\u4e71\u5927\u8c0b\u3002<\/li>\r\n<\/ul> \r\n<hr \/> \r\n<ul id=\"list2\"> \r\n<li>\u9000\u7b14\u5982\u5c71\u8d77\u8db3\u73cd\uff0c\u8bfb\u4e66\u4e07\u5377\u59cb\u901a\u795e<\/li> \r\n<li>\u8bfb\u4e66\u5982\u679c\u4e0d\u660e\u767d\u9053\u7406\uff0c\u7b49\u4e8e\u767d\u8bfb\u3002<\/li> \r\n<li>\u4ece\u67d0\u79cd\u610f\u4e49\u4e0a\u8bf4\u6ca1\u6709\u4e00\u672c\u4e66\u662f\u574f\u7684\u6b63\u5982\u6ca1\u6709\u4e00\u4e2a\u5973\u4eba\u662f\u4e11\u7684\u3002<\/li> \r\n<li>\u9053\u4e0d\u540c\uff0c\u4e0d\u76f8\u4e3a\u8c0b\u3002<\/li> \r\n<li>\u4e0d\u60a3\u5be1\u800c\u60a3\u4e0d\u5747\uff0c\u4e0d\u60a3\u8d2b\u800c\u60a3\u4e0d\u5b89\u3002<\/li> \r\n<li>\u4e0d\u4e49\u800c\u5bcc\u4e14\u8d35\uff0c\u4e8e\u6211\u5982\u6d6e\u4e91\u3002<\/li>\r\n<li>\u4e0d\u5728\u5176\u4f4d\uff0c\u4e0d\u8c0b\u5176\u653f\u3002<\/li> \r\n<li>\u540d\u4e0d\u6b63\uff0c\u5219\u8a00\u4e0d\u987a\uff1b\u8a00\u4e0d\u987a\uff0c\u5219\u4e8b\u4e0d\u6210\u3002<\/li> \r\n<li>\u5176\u8eab\u6b63\uff0c\u4e0d\u4ee4\u800c\u884c\uff1b\u5176\u8eab\u4e0d\u6b63\uff0c\u867d\u4ee4\u4e0d\u4ece\u3002<\/li> \r\n<li>\u4e00\u8a00\u800c\u5174\u90a6\uff0c\u4e00\u8a00\u800c\u4e27\u90a6\u3002<\/li> \r\n<li>\u541b\u5b50\u803b\u5176\u8a00\u800c\u8fc7\u5176\u884c\u3002<\/li> \r\n<li>\u4e0d\u60a3\u4eba\u4e4b\u4e0d\u5df1\u77e5\uff0c\u60a3\u4e0d\u77e5\u4eba\u4e5f\u3002<\/li>\r\n<\/ul> <\/code><\/pre>\n

\u6839\u636e\u81ea\u5df1\u9700\u8981\u9009\u62e9\u76f8\u5173\u6837\u5f0f\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u7eafCSS\u6587\u7ae0\u5217\u8868\u9694\u884c\u6362\u8272 \u5148\u770b\u770b\u6548\u679c\uff1a \u9694\u56db\u884c\u6362\u8272 \u5176\u4ed6\u6837\u5f0f\u53ef\u81ea\u884c\u4fee\u6539\u3002\u6bd4\u5982\u9694\u884c\u52a0\u7c97\uff0c\u5b57\u4f53\u53d8\u5927\u7b49\u3002 CSS\u6837\u5f0f […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[351,693,1460,1459],"class_list":["post-4514","post","type-post","status-publish","format-standard","hentry","category-web","tag-351","tag-css","tag-1460","tag-1459"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/4514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=4514"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/4514\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=4514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=4514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=4514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}