{"id":2162,"date":"2024-11-10T14:13:03","date_gmt":"2024-11-10T06:13:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2162\/"},"modified":"2024-11-10T14:13:03","modified_gmt":"2024-11-10T06:13:03","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-css-%e5%ae%9e%e7%8e%b0%e7%ba%a2%e6%a1%86%e5%86%85%e6%95%88%e6%9e%9c%ef%bc%8c%e5%8d%b3%e6%96%87%e5%ad%97%e4%b8%a4%e8%be%b9%e4%b8%ad%e9%97%b4%e7%9a%84%e7%ba%bf","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2162\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u7ea2\u6846\u5185\u6548\u679c\uff0c\u5373\u6587\u5b57\u4e24\u8fb9\u4e2d\u95f4\u7684\u7ebf\u6761\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173068093145486.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u7ea2\u6846\u5185\u6548\u679c\uff0c\u5373\u6587\u5b57\u4e24\u8fb9\u4e2d\u95f4\u7684\u7ebf\u6761\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u7ea2\u6846\u5185\u6548\u679c\uff0c\u5373\u6587\u5b57\u4e24\u8fb9\u4e2d\u95f4\u7684\u7ebf\u6761\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u901a\u8fc7  \u5b9e\u73b0\u7ea2\u6846\u5185\u6548\u679c<\/strong><\/p>\n<p>\u4e3a\u4e86\u5b9e\u73b0\u7ea2\u6846\u5185\u7684\u6548\u679c\uff0c\u5373\u6587\u5b57\u4e24\u8fb9\u4e2d\u95f4\u7684\u7ebf\u6761\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b css \u4ee3\u7801\uff1a<\/p>\n<pre>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n    &lt;head&gt;\n        &lt;meta charset=\"UTF-8\" \/&gt;\n        &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/&gt;\n        &lt;title&gt;Document&lt;\/title&gt;\n        &lt;style&gt;\n            \/* \u91cd\u7f6e\u4e00\u4e0b\u6837\u5f0f *\/\n            * {\n                margin: 0;\n                padding: 0;\n            }\n            \/* \u521b\u5efa\u4e00\u4e2a\u6587\u672c\u5bb9\u5668 *\/\n            .text {\n                display: flex;\n                align-items: center;\n                justify-content: center;\n            }\n            \/* \u6dfb\u52a0\u4f2a\u5143\u7d20\u5728\u6587\u672c\u524d\u540e *\/\n            .text::before {\n                \/* \u6dfb\u52a0\u7a7a\u5185\u5bb9 *\/\n                content: \"\";\n                \/* \u8bbe\u7f6e flex \u6bd4\u4f8b\u4e3a 1 *\/\n                flex: 1;\n                \/* \u8bbe\u7f6e\u7ea2\u8272\u80cc\u666f *\/\n                background-color: red;\n                \/* \u8bbe\u7f6e\u9ad8\u5ea6\u4e3a 1px *\/\n                height: 1px;\n                \/* \u8bbe\u7f6e\u53f3\u4fa7\u8ddd *\/\n                margin-right: 10px;\n            }\n            .text::after {\n                \/* \u6dfb\u52a0\u7a7a\u5185\u5bb9 *\/\n                content: \"\";\n                \/* \u8bbe\u7f6e flex \u6bd4\u4f8b\u4e3a 1 *\/\n                flex: 1;\n                \/* \u8bbe\u7f6e\u7ea2\u8272\u80cc\u666f *\/\n                background-color: red;\n                \/* \u8bbe\u7f6e\u9ad8\u5ea6\u4e3a 1px *\/\n                height: 1px;\n                \/* \u8bbe\u7f6e\u5de6\u4fa7\u8ddd *\/\n                margin-left: 10px;\n            }\n        &lt;\/style&gt;\n    &lt;\/head&gt;\n    &lt;body&gt;\n        \/* \u6dfb\u52a0\u6587\u672c\u5230\u5bb9\u5668\u5185 *\/\n        &lt;div class=\"text\"&gt;\u4e00\u6bb5\u6587\u5b57&lt;\/div&gt;\n    &lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u6587\u672c\u5bb9\u5668\uff0c\u5176\u4e2d\u6587\u672c\u4e24\u8fb9\u5404\u6709\u4e00\u6761\u7ea2\u8272\u7684\u7ebf\u6761\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u7ea2\u6846\u5185\u6548\u679c\uff0c\u5373\u6587\u5b57\u4e24\u8fb9\u4e2d\u95f4\u7684\u7ebf\u6761\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u8fc7 \u5b9e\u73b0\u7ea2\u6846\u5185\u6548\u679c \u4e3a\u4e86\u5b9e\u73b0\u7ea2\u6846\u5185\u7684\u6548\u679c\uff0c\u5373\u6587\u5b57\u4e24\u8fb9\u4e2d\u95f4\u7684\u7ebf\u6761\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b css \u4ee3\u7801\uff1a &lt;!DOCTYPE html&gt; &lt;html lang=&#8221;en&#8221;&gt; &lt;head&gt; &lt;meta charset=&#8221;UTF-8&#8243; \/&gt; &lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243; \/&gt; &lt;title&gt;Document&lt;\/title&gt; &lt;style&gt; \/* \u91cd\u7f6e\u4e00\u4e0b\u6837\u5f0f *\/ * { margin: 0; padding: 0; } \/* \u521b\u5efa\u4e00\u4e2a\u6587\u672c\u5bb9\u5668 *\/ .text { display: flex; align-items: center; justify-content: center; } \/* \u6dfb\u52a0\u4f2a\u5143\u7d20\u5728\u6587\u672c\u524d\u540e *\/ .text::before { \/* \u6dfb\u52a0\u7a7a\u5185\u5bb9 *\/ content: &#8220;&#8221;; \/* \u8bbe\u7f6e flex [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2162","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=2162"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2162\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}