{"id":225,"date":"2008-05-28T12:56:34","date_gmt":"2008-05-28T12:56:34","guid":{"rendered":"http:\/\/www.ddcat.net\/blog2009\/?p=225"},"modified":"2008-05-28T12:56:34","modified_gmt":"2008-05-28T12:56:34","slug":"46%e5%b1%82%e5%8f%a0","status":"publish","type":"post","link":"http:\/\/www.ddcat.net\/blog\/index.php\/2008\/05\/28\/46%e5%b1%82%e5%8f%a0\/","title":{"rendered":"4.6\u5c42\u53e0"},"content":{"rendered":"<p>\u5728\u672c\u4e66\u7684[2.3.1 (X)HTML\u4e0e\u6d4f\u89c8\u5668\u5185\u7f6e\u6837\u5f0f]\u4e00\u8282\u66fe\u7ecf\u4ecb\u7ecd\u8fc7\uff0c\u6837\u5f0f\u8868\u53ef\u80fd\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u6765\u6e90\uff1a\u5236\u4f5c\u8005\u3001\u7528\u6237\u548c\u6d4f\u89c8\u5668\u3002\u8fd9\u4e09\u4e2a\u6765\u6e90\u7684\u6837\u5f0f\u8868\u53ef\u80fd\u5728\u8303\u56f4\u4e0a\u6709\u91cd\u53e0\uff0c\u5b83\u4eec\u6839\u636e\u5c42\u53e0\u89c4\u5219\u4e92\u76f8\u4f5c\u7528\u3002<\/p>\n<h3>4.6.1 \u5c42\u53e0\u7684\u987a\u5e8f<\/h3>\n<p>CSS\u7684\u5c42\u53e0\u5bf9\u6bcf\u4e00\u4e2a\u6837\u5f0f\u89c4\u5219\u6307\u5b9a\u4e00\u4e2a\u6743\u91cd\u3002\u5982\u679c\u8981\u5e94\u7528\u82e5\u5e72\u4e2a\u89c4\u5219\uff0c\u90a3\u4e48\u6743\u91cd\u6700\u5927\u7684\u90a3\u4e2a\u89c4\u5219\u5177\u6709\u4f18\u5148\u6743\u3002\u5c42\u53e0\u89c4\u5219\u4f9d\u636e\u4e0b\u9762\u51e0\u4e2a\u6b65\u9aa4\u8fdb\u884c\uff1a<\/p>\n<p><!--more--><\/p>\n<h4>1. \u67e5\u627e\u6709\u51b2\u7a81\u7684\u5143\u7d20<\/h4>\n<p>\u6d4f\u89c8\u5668\u4f1a\u627e\u5230\u90a3\u4e9b\u5b58\u5728\u7591\u95ee\u7684\u5143\u7d20\u548c\u5c5e\u6027\u7684\u58f0\u660e\uff0c\u5982\u679c\u76f8\u5173\u8054\u7684\u9009\u62e9\u5668\u5339\u914d\u5b58\u5728\u7591\u95ee\u7684\u5143\u7d20\uff0c\u5219\u58f0\u660e\u9002\u7528\u3002<\/p>\n<h4>2. \u6837\u5f0f\u8868\u7684\u6765\u6e90<\/h4>\n<p>\u6309\u7167\u89c4\u5219\u7684\u91cd\u8981\u6027\uff08\u666e\u901a\u6216\u8005\u91cd\u8981\uff09\u548c\u6765\u6e90\uff08\u7528\u6237\u3001\u5236\u4f5c\u8005\u6216\u8005\u6d4f\u89c8\u5668\uff09\u6765\u4ece\u4f4e\u5230\u9ad8\u6392\u5e8f\uff1a<br \/>\n1) \u6d4f\u89c8\u5668\u7684\u7f3a\u7701\u6837\u5f0f\uff1b<br \/>\n2) \u7528\u6237\u5b9a\u4e49\u7684\u666e\u901a\u6837\u5f0f\uff1b<br \/>\n3) \u5236\u4f5c\u8005\u5b9a\u4e49\u7684\u666e\u901a\u6837\u5f0f\uff1b<br \/>\n4) \u5236\u4f5c\u8005\u5b9a\u4e49\u7684\u91cd\u8981\u6027\uff08\u201c!important\u201d\u58f0\u660e\uff09\u6837\u5f0f\uff1b<br \/>\n5) \u7528\u6237\u5b9a\u4e49\u7684\u91cd\u8981\u6027\uff08\u201c!important\u201d\u58f0\u660e\uff09\u6837\u5f0f\u3002<\/p>\n<div class=\"note\">\u63d0\u793a\uff1a\u91cd\u8981\u6027\uff08\u201c!important\u201d\u58f0\u660e\uff09\uff0c\u8bf7\u53c2\u89c1\u672c\u4e66[4.6.4 \u91cd\u8981\u6027]\u4e00\u8282\u3002<\/div>\n<p>\u5bf9\u4e8e\u5236\u4f5c\u8005\u5b9a\u4e49\u7684\u5916\u90e8CSS\u6587\u4ef6\u5f15\u5165\u7684\u89c4\u5219\uff0c\u5b83\u4eec\u7684\u6743\u91cd\u53d6\u51b3\u4e8e\u5b83\u4eec\u5f15\u5165\u7684\u987a\u5e8f\u3002\u4f8b\u5982\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"html\">&lt;link rel=\"stylesheet\" href=\"basic.css\" type=\"text\/css\" media=\"all\" \/&gt;\n&lt;link rel=\"stylesheet\" href=\"font.css\" type=\"text\/css\" media=\"all\" \/&gt;<\/pre>\n<\/div>\n<p>\u5219font.css\u4e2d\u7684\u5b9a\u4e49\u9ad8\u4e8ebasic.css\u4e2d\u7684\u5b9a\u4e49\u3002<\/p>\n<p>\u5bf9\u4e8e\u5728\u6837\u5f0f\u8868\u4e2d\u4f7f\u7528@import\u89c4\u5219\u5f15\u5165\u7684\u5176\u4ed6\u6837\u5f0f\u8868\uff0c\u4f18\u5148\u7ea7\u89c4\u5219\u540c\u6837\u9002\u7528\u3002<\/p>\n<p>\u5d4c\u5165\u5f0f\u6837\u5f0f\u8868\u7684\u89c4\u5219\u9ad8\u4e8e\u4ece\u6587\u4ef6\u5f15\u5165\u7684\u6837\u5f0f\u89c4\u5219\u3002\u884c\u5185\u6837\u5f0f\u8868\u5219\u53c8\u9ad8\u4e8e\u5d4c\u5165\u5f0f\u6837\u5f0f\u8868\u3002<\/p>\n<h4>3. \u9009\u62e9\u5668\u7684\u7279\u6b8a\u6027<\/h4>\n<p>\u58f0\u660e\u7684\u7b2c2\u6392\u5e8f\u57fa\u4e8e\u9009\u62e9\u5668\u7684\u7279\u6b8a\u6027\uff1a\u7279\u6b8a\u7684\u9009\u62e9\u5668\u8d85\u8d8a\u4e00\u822c\u7684\u9009\u62e9\u5668\u3002\u4f2a\u5143\u7d20\u548c\u4f2a\u7c7b\u5206\u522b\u88ab\u89c6\u4e3a\u4e00\u822c\u5143\u7d20\u548c\u4e00\u822c\u7c7b\u3002<\/p>\n<h4>4. \u89c4\u5219\u51fa\u73b0\u7684\u5148\u540e\u6b21\u5e8f<\/h4>\n<p>\u6700\u540e\uff0c\u6839\u636e\u89c4\u5219\u51fa\u73b0\u7684\u5148\u540e\u6b21\u5e8f\u6765\u6392\u5217\u3002\u5982\u679c\u4e24\u6761\u89c4\u5219\u5177\u6709\u76f8\u540c\u7684\u6743\u91cd\uff0c\u76f8\u540c\u7684\u6765\u6e90\u548c\u76f8\u540c\u7684\u7279\u6b8a\u6027\uff0c\u5219\u540e\u51fa\u73b0\u7684\u89c4\u5219\u8d85\u8d8a\u5148\u51fa\u73b0\u7684\u89c4\u5219\u3002<\/p>\n<p>\u5f15\u5165\u7684\u6837\u5f0f\u8868\u4e2d\u7684\u89c4\u5219\u88ab\u8ba4\u4e3a\u51fa\u73b0\u5728\u6837\u5f0f\u8868\u672c\u8eab\u7684\u6240\u6709\u89c4\u5219\u4e4b\u524d\u3002<\/p>\n<p>\u9664\u4e86\u4e2a\u522b\u58f0\u660e\u7684\u201c!important\u201d\u6307\u5b9a\uff0c\u4e0a\u8ff0\u7b56\u7565\u7ed9\u4e88\u5236\u4f5c\u8005\u7684\u6837\u5f0f\u8868\u6bd4\u7528\u6237\u6837\u5f0f\u8868\u66f4\u5927\u7684\u6743\u91cd\u3002<\/p>\n<h3>4.6.2\u7279\u6b8a\u6027\u7684\u8ba1\u7b97<\/h3>\n<p>\u65e2\u7136\u6709\u5c42\u53e0\u7684\u89c4\u5219\uff0c\u90a3\u4e48\uff0c\u5982\u679c\u6709\u5982\u4e0b\u4ee3\u7801\uff0c\u5176\u5728\u6d4f\u89c8\u5668\u5185\u4f1a\u5982\u4f55\u663e\u793a\u5462\uff1f<\/p>\n<div class=\"code\">\n<pre class=\"css\">.warning { color: red; }\np { color: green; }<\/pre>\n<pre class=\"html\">&lt;p class=\"warning\"&gt;\u5c42\u53e0\u548c\u7ee7\u627f\u7684\u89c4\u5219\u5982\u4f55\u5b9e\u73b0\uff1f&lt;\/p&gt;<\/pre>\n<\/div>\n<p>\u6b64\u4ee3\u7801\u5728\u6d4f\u89c8\u5668\u5185\u663e\u793a\u5982\u56fe4-31\u6240\u793a\u3002<\/p>\n<div style=\"width: 343px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" title=\"\u56fe4-31 \u9009\u62e9\u5668\u7684\u7279\u6b8a\u6027\" src=\"\/web\/css\/selectors\/031.gif\" alt=\"\" width=\"333\" height=\"169\" \/><p class=\"wp-caption-text\">\u56fe4-31 \u9009\u62e9\u5668\u7684\u7279\u6b8a\u6027<\/p><\/div>\n<p style=\"text-align: center;\">\n<p>\u8fd9\u662f\u7531\u4e8e\u7c7b\u9009\u62e9\u5668\u201cwarning\u201d\u548c\u7c7b\u578b\u9009\u62e9\u5668\u201cp\u201d\u7684\u201c\u7279\u6b8a\u6027\u201d\u4e0d\u540c\u3002<\/p>\n<p>\u7279\u6b8a\u6027\uff08specificity\uff09\u63cf\u8ff0\u4e86\u4e0d\u540c\u9009\u62e9\u5668\u7684\u76f8\u5bf9\u6743\u91cd\uff08weight\uff09\u3002\u4e00\u4e2a\u9009\u62e9\u5668\u7684\u7279\u6b8a\u6027\u662f\u8fd9\u6837\u8ba1\u7b97\u7684\uff1a<\/p>\n<p>\u30fb\u5982\u679cCSS\u5c5e\u6027\u662f\u901a\u8fc7(X)HTML\u5143\u7d20\u7684style\u5c5e\u6027\u5b9a\u4e49\u7684\uff0c\u5219\u8bb0\u4e3aa=1\uff0c\u5426\u5219\u8bb0\u4e3a0\uff1b<br \/>\n\u7531\u4e8estyle\u5c5e\u6027\u662f\u5199\u5728(X)HTML\u6807\u7b7e\u5185\u7684\uff0c\u56e0\u6b64\u4e0d\u5b58\u5728\u9009\u62e9\u5668\uff0c\u6240\u4ee5\uff1aa=1, b=0, c=0, \u4e14 d=0\uff1b<br \/>\n\u30fb\u8ba1\u7b97\u9009\u62e9\u5668\u4e2dID\u9009\u62e9\u5668\u7684\u6570\u91cf\uff0c\u8ba1\u4e3ab\uff1b<br \/>\n\u30fb\u8ba1\u7b97\u9009\u62e9\u5668\u4e2d\u7c7b\u9009\u62e9\u5668\u3001\u5c5e\u6027\u9009\u62e9\u5668\u548c\u4f2a\u7c7b\u7684\u6570\u91cf\uff0c\u8ba1\u4e3ac\uff1b<br \/>\n\u30fb\u8ba1\u7b97\u9009\u62e9\u5668\u4e2d\u7c7b\u578b\u9009\u62e9\u5668\u7684\u6570\u91cf\uff0c\u8ba1\u4e3ad\uff1b<br \/>\n\u30fb\u5ffd\u7565\u4f2a\u5143\u7d20\u3002<\/p>\n<p>\u5c06\u8fd94\u4e2a\u6570\u5b57\uff08a, b, c, d\uff09\u76f8\u8fde\uff08\u6570\u5b57\u8fdb\u5236\u8981\u4ee5\u5927\u7684\u4e3a\u51c6\uff09\uff0c\u5f97\u5230\u7279\u6b8a\u6027\u3002\u4f8b\u5982\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"css\"> { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 0, 0, 0\nli { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 0, 0, 1\nul li { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 0, 0, 2\nul ol+li { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 0, 0, 3\nh1 + [rel=\"up\"] { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 0, 1, 1\nul ol li.warning { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 0, 1, 3\nli.menu.level { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 0, 2, 1\n#x34y { \u2026\u2026 }         \u7279\u6b8a\u6027 = 0, 1, 0, 0<\/pre>\n<pre class=\"html\">&lt;p styel=\u201d\u2026\u2026\u201d&gt;         \u7279\u6b8a\u6027 = 1, 0, 0, 0<\/pre>\n<\/div>\n<p>\u7279\u6b8a\u6027\u9ad8\u7684\u89c4\u5219\u4f1a\u53d6\u4ee3\u7279\u6b8a\u6027\u4f4e\u7684\u89c4\u5219\uff0c\u65e0\u8bba\u5176\u4e66\u5199\u7684\u5148\u540e\u987a\u5e8f\u5982\u4f55\uff0c\u4f8b\u5982\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"css\">h1 {color red;}           0,0,0,1\nbody h1 {color green;}   0,0,0,2 \uff08\u80dc\u51fa\uff09<\/pre>\n<\/div>\n<p>\u6216\u8005\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"html\">h2.grape {color purple;}    0,0,1,1 (\u80dc\u51fa)\nh2 {color silver;}          0,0,0,1<\/pre>\n<\/div>\n<h3>4.6.3 \u7ee7\u627f\u548c\u7279\u6b8a\u6027<\/h3>\n<p>\u5728\u7279\u6b8a\u6027\u7684\u6846\u67b6\u4e0b\uff0c\u7ee7\u627f\u7684\u7279\u6b8a\u6027\u4e3a\u201c0\u201d\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u4efb\u4f55\u663e\u5f0f\u7684\u89c4\u5219\u58f0\u660e\u90fd\u4f1a\u8986\u76d6\u6389\u7ee7\u627f\u7684\u6837\u5f0f\uff0c\u4f8b\u5982\u6709\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"html\">em { color: blue; }\np.list { color: gray; }<\/pre>\n<pre>&lt;p class=\"list\"&gt;\u7ee7\u627f\u7684\u7279\u6b8a\u6027\u4e3a&lt;em&gt;\u201c0\u201d&lt;\/em&gt;\u3002&lt;\/p&gt;<\/pre>\n<\/div>\n<p>\u867d\u7136\u201cp.list\u201d\u7684\u7279\u6b8a\u6027\u4e3a\u201c0, 0, 1, 1\u201d\uff0c\u4f46\u662f\uff0c\u5bf9\u201cem\u201d\u7684color\u58f0\u660e\u8fd8\u662f\u4f1a\u8986\u76d6\u6389\u4ece\u201cp.list\u201d\u7ee7\u627f\u7684color\u6837\u5f0f\uff0c\u56e0\u6b64\u5728\u6d4f\u89c8\u5668\u5185\u663e\u793a\u5982\u56fe4-32\u6240\u793a\u3002<\/p>\n<div style=\"width: 315px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" title=\"\u56fe4-32 \u7ee7\u627f\u4e0e\u7279\u6b8a\u6027\" src=\"\/web\/css\/selectors\/032.gif\" alt=\"\" width=\"305\" height=\"197\" \/><p class=\"wp-caption-text\">\u56fe4-32 \u7ee7\u627f\u4e0e\u7279\u6b8a\u6027<\/p><\/div>\n<p style=\"text-align: center;\">\n<p>\u56e0\u6b64\uff0c\u5982\u679c\u9700\u8981\u8ba9p\u5185\u7684em\u80fd\u5448\u73b0\u548cp\u4e00\u6837\u7684\u989c\u8272\uff0c\u5219\u9700\u8981\u5982\u4e0b\u5b9a\u4e49\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"html\">p.list,\np.list em { color gray; }<\/pre>\n<\/div>\n<h3>4.6.4 \u91cd\u8981\u6027<\/h3>\n<p>\u867d\u7136\u5c42\u53e0\u548c\u7279\u6b8a\u6027\u51b3\u5b9a\u4e86CSS\u89c4\u5219\u7684\u6700\u540e\u5e94\u7528\u6548\u679c\uff0c\u4f46\u662f\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u58f0\u660e\u67d0\u4e2a\u89c4\u5219\u7684\u201c\u91cd\u8981\u6027\u201d\u6765\u63d0\u9ad8\u6b64\u89c4\u5219\u7684\u6743\u91cd\uff0c\u4f8b\u5982\u56fe4-33\u6240\u793a\u3002<\/p>\n<div style=\"width: 384px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" title=\"\u56fe4-33 \u91cd\u8981\u6027\u7684\u8868\u73b0\" src=\"\/web\/css\/selectors\/033.gif\" alt=\"\" width=\"374\" height=\"186\" \/><p class=\"wp-caption-text\">\u56fe4-33 \u91cd\u8981\u6027\u7684\u8868\u73b0<\/p><\/div>\n<p style=\"text-align: center;\">\n<p>\u867d\u7136ID\u9009\u62e9\u5668\u7684\u7279\u6b8a\u6027\u9ad8\u4e8e\u7c7b\u578b\u9009\u62e9\u5668\uff0c\u4f46\u662f\u7531\u4e8e\u7c7b\u578b\u9009\u62e9\u5668\uff08div\uff09\u5c5e\u6027\u503c\u540e\u9762\u6dfb\u52a0\u4e86\u201c!important\u201d\u91cd\u8981\u6027\u58f0\u660e\uff0c\u56e0\u6b64\u201ccolor : red\u201d\u8fd9\u6761\u58f0\u660e\u7684\u7279\u6b8a\u6027\u6700\u9ad8\u3002<br \/>\n\u201c!important\u201d\u91cd\u8981\u6027\u58f0\u660e\u7684\u6743\u91cd\u751a\u81f3\u9ad8\u4e8e\u5185\u8054\u5f0f\u6837\u5f0f\uff0c\u4f8b\u5982\u6709\u5982\u4e0b\u4ee3\u7801\uff0c\u5176\u5728\u6d4f\u89c8\u5668\u5185\u663e\u793a\u5982\u56fe4-34\u6240\u793a\u3002<\/p>\n<div class=\"code\">\n<pre class=\"css\">div { color: red !important; }<\/pre>\n<pre class=\"html\">&lt;div style=\"color: blue;\"&gt;\u8bbe\u5b9a\u4e86style\u7684div&lt;\/div&gt;<\/pre>\n<\/div>\n<div style=\"width: 340px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" title=\"\u56fe4-34 \u91cd\u8981\u6027\u7684\u6743\u91cd\u9ad8\u4e8e\u5185\u5d4c\u5f0f\u6837\u5f0f\" src=\"\/web\/css\/selectors\/034.gif\" alt=\"\" width=\"330\" height=\"181\" \/><p class=\"wp-caption-text\">\u56fe4-34 \u91cd\u8981\u6027\u7684\u6743\u91cd\u9ad8\u4e8e\u5185\u5d4c\u5f0f\u6837\u5f0f<\/p><\/div>\n<p>\u5728CSS 1\u4e2d\uff0c\u5236\u4f5c\u8005\u7684\u201c!important\u201d\u89c4\u5219\u8d85\u8d8a\u7528\u6237\u7684\u201c!important\u201d\u89c4\u5219\u3002\u4f46\u662f\u5728CSS 2\u4e2d\uff0c\u7528\u6237\u7684\u201c!important\u201d\u89c4\u5219\u5177\u6709\u6700\u9ad8\u7684\u4f18\u5148\u7ea7\uff0c\u8fd9\u6837\u53ef\u4ee5\u8ba9\u7f51\u9875\u66f4\u5177\u6613\u7528\u6027\uff0c\u4f8b\u5982\u6709\u4e9b\u89c6\u529b\u4e0d\u597d\u7684\u7528\u6237\uff0c\u53ef\u80fd\u4f1a\u8bbe\u5b9a\u6bd4\u8f83\u5927\u7684\u5b57\u4f53\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u9632\u6b62\u5236\u4f5c\u8005\u5b9a\u4e49\u4e86\u8fc7\u5c0f\u7684\u5b57\u4f53\u800c\u4f7f\u7528\u6237\u9605\u8bfb\u56f0\u96be\u3002<\/p>\n<h3>4.6.5 \u975eCSS\u7684\u8868\u73b0\u7c7b\u5185\u5bb9<\/h3>\n<p>\u73b0\u5728\u4ecd\u7136\u6709\u4e00\u4e9b\u5236\u4f5c\u8005\u5728(X)HTML\u6587\u6863\u5185\u63d2\u5165\u4e00\u4e9b\u8868\u73b0\u7c7b\u7684\u5185\u5bb9\uff0c\u4f8b\u5982&lt;font&gt;\u6807\u7b7e\u548calign\u5c5e\u6027\uff0c\u8fd9\u4e9b\u8868\u73b0\u7c7b\u7684\u5185\u5bb9\u88ab\u8ba4\u4e3a\u5177\u67090\u7279\u6b8a\u6027\uff0c\u5e76\u4e14\u88ab\u5f53\u4f5c\u662f\u63d2\u5165\u5728\u4f5c\u8005\u6837\u5f0f\u8868\u7684\u5f00\u5934\u90e8\u5206\uff0c\u56e0\u6b64\u53ef\u80fd\u4f1a\u88ab\u540e\u9762\u5b9a\u4e49\u7684\u6837\u5f0f\u89c4\u5219\u8986\u76d6\u3002<\/p>\n<p>\u4f8b\u5982\u4e0b\u5217\u4ee3\u7801\u5728\u6d4f\u89c8\u5668\u5185\u663e\u793a\u5982\u56fe4-35\u6240\u793a\u3002<\/p>\n<div class=\"code\">\n<pre class=\"css\">p {\nbackground: yellow;\ntext-align: left;\n}<\/pre>\n<pre class=\"html\">&lt;p align=\"right\"&gt;&amp;lt;p align=&amp;quot;right&amp;quot;&amp;gt;\uff0cCSS\uff1atext-align: left;&lt;\/p&gt;<\/pre>\n<\/div>\n<div style=\"width: 530px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" title=\"\u56fe4-35 \u6837\u5f0f\u89c4\u5219\u6743\u91cd\u9ad8\u4e8eHTML\u5143\u7d20\u7684\u8868\u73b0\u7c7b\u5c5e\u6027\" src=\"\/web\/css\/selectors\/035.gif\" alt=\"\" width=\"520\" height=\"208\" \/><p class=\"wp-caption-text\">\u56fe4-35 \u6837\u5f0f\u89c4\u5219\u6743\u91cd\u9ad8\u4e8eHTML\u5143\u7d20\u7684\u8868\u73b0\u7c7b\u5c5e\u6027<\/p><\/div>\n<p>\u75314-35\u8bfb\u8005\u53ef\u4ee5\u770b\u5230\uff0c\u867d\u7136&lt;p&gt;\u7684align\u5c5e\u6027\u5b9a\u4e49\u4e3a\u201cright\u201d\uff0c\u5373\u53f3\u5bf9\u9f50\uff0c\u4f46\u662f\u7531\u4e8eCSS\u4e2d\u5b9a\u4e49\u4e86\u201ctext-align: left;\u201d\uff0c\u56e0\u6b64\u6587\u5b57\u8fd8\u662f\u5de6\u5bf9\u9f50\u663e\u793a\u3002<br \/>\n\u4f46\u662f\uff0c\u5982\u679c\u662f\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"css\">.test { color: green; }<\/pre>\n<pre class=\"html\">&lt;p class=\"test\"&gt;p\u5185\u7684\u793a\u4f8b&lt;font color=\"blue\"&gt;\u6587\u5b57&lt;\/font&gt;\u3002&lt;\/p&gt;<\/pre>\n<\/div>\n<p>\u5219&lt;font&gt;\u5185\u7684\u6587\u5b57\u4f9d\u7136\u662f\u84dd\u8272\uff08blue\uff09\uff0c\u56e0\u4e3a\u5bf9\u4e8e&lt;font&gt;\uff0c&lt;p&gt;\u7684color\u5c5e\u4e8e\u7ee7\u627f\uff0c\u56e0\u6b64\u6807\u7b7e\u5185\u7684\u5c5e\u6027\u9ad8\u4e8e\u7ee7\u627f\u503c\uff0c\u4f46\u662f\u5982\u679c\u589e\u52a0CSS\u89c4\u5219\uff1a<\/p>\n<div class=\"code\">\n<pre class=\"css\">font { color: red; }<\/pre>\n<\/div>\n<p>\u5219&lt;font&gt;\u5185\u7684\u6587\u5b57\u4f1a\u53d8\u4e3a\u7ea2\u8272\uff08red\uff09\uff0c\u5373\u201ccolor=&#8221;blue&#8221;\u201d\u88abCSS\u7684\u201ccolor: red; \u201d\u8986\u76d6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6837\u5f0f\u8868\u53ef\u80fd\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u6765\u6e90\uff1a\u5236\u4f5c\u8005\u3001\u7528\u6237\u548c\u6d4f\u89c8\u5668\u3002\u8fd9\u4e09\u4e2a\u6765\u6e90\u7684\u6837\u5f0f\u8868\u53ef\u80fd\u5728\u8303\u56f4\u4e0a\u6709\u91cd\u53e0\uff0c\u5b83\u4eec\u6839\u636e\u5c42\u53e0\u89c4\u5219\u4e92\u76f8\u4f5c\u7528\u3002\u6837\u7ae0\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4,20],"tags":[44,172,222,253],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-web","category-biejuguangmang","category-web-css","tag-css","tag-172","tag-222","tag-253"],"_links":{"self":[{"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":0,"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ddcat.net\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}