{"id":1236,"date":"2024-11-10T08:44:41","date_gmt":"2024-11-10T00:44:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1236\/"},"modified":"2024-11-10T08:44:41","modified_gmt":"2024-11-10T00:44:41","slug":"html-%e5%92%8c-css-%e4%bb%a3%e7%a0%81%e4%b8%ad%ef%bc%8c%e4%b8%a4%e4%b8%aa%e5%ad%90%e7%9b%92%e5%ad%90%e4%b8%ba%e4%bb%80%e4%b9%88%e6%97%a0%e6%b3%95%e6%a8%aa%e5%90%91%e6%8e%92%e5%88%97%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1236\/","title":{"rendered":"HTML \u548c CSS \u4ee3\u7801\u4e2d\uff0c\u4e24\u4e2a\u5b50\u76d2\u5b50\u4e3a\u4ec0\u4e48\u65e0\u6cd5\u6a2a\u5411\u6392\u5217\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173033788760026.jpg\" class=\"aligncenter\" title=\"HTML \u548c CSS \u4ee3\u7801\u4e2d\uff0c\u4e24\u4e2a\u5b50\u76d2\u5b50\u4e3a\u4ec0\u4e48\u65e0\u6cd5\u6a2a\u5411\u6392\u5217\uff1f\u63d2\u56fe\" alt=\"HTML \u548c CSS \u4ee3\u7801\u4e2d\uff0c\u4e24\u4e2a\u5b50\u76d2\u5b50\u4e3a\u4ec0\u4e48\u65e0\u6cd5\u6a2a\u5411\u6392\u5217\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e3a\u4ec0\u4e48\u4e24\u4e2a\u5b50\u76d2\u65e0\u6cd5\u6a2a\u5411\uff1f<\/strong><\/p>\n<p>\u4ee5\u4e0b html \u548c  \u4ee3\u7801\u4e2d\uff0c\u4e24\u4e2a\u5b50\u76d2\u5b50 box1 \u548c box2 \u9884\u671f\u5e94\u8be5\u6a2a\u5411\u6392\u5217\uff0c\u4f46\u5b9e\u9645\u5374\u6ca1\u6709\uff1a<\/p>\n<pre>&lt;div class=\"container\"&gt;\n  &lt;div class=\"box1\"&gt;&lt;\/div&gt;\n  &lt;div class=\"box2\"&gt;&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>* {\n  box-sizing: border-box;\n  padding: 0;\n  margin: 0;\n}\n\n.container {\n  height: 300px;\n  width: 500px;\n}\n\n.box1 {\n  display: inline-flex;\n  width: 50%;\n  height: 100%;\n  background-color: #87CEFA;\n}\n\n.box2 {\n  display: inline-flex;\n  height: 100%;\n  width: 50%;\n  background-color: #FFC0CB;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a\u7ed9\u5b50\u76d2\u5b50\u8bbe\u7f6e\u4e86 inline-flex \u7684 display \u5c5e\u6027\u3002inline-flex \u5c5e\u6027\u4f7f\u5f97\u5b50\u76d2\u5b50\u4f5c\u4e3a\u884c\u5185\u5143\u7d20\u5728\u7236\u5bb9\u5668\u4e2d\u6392\u5217\uff0c\u800c\u884c\u5185\u5143\u7d20\u4e4b\u95f4\u9ed8\u8ba4\u4f1a\u6709 1em\/4 \u7684\u95f4\u9699\u3002\u56e0\u6b64\uff0c\u4e24\u4e2a 50% \u5bbd\u5ea6\u7684\u5b50\u76d2\u5b50\u65e0\u6cd5\u5728\u7236\u5bb9\u5668\u4e2d\u6a2a\u5411\u6392\u5217\u3002<\/p>\n<p>\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u5c06\u7236\u5143\u7d20\u7684 display \u5c5e\u6027\u4fee\u6539\u4e3a flex\uff0c\u7136\u540e\u5c06\u5b50\u76d2\u5b50\u7684 display \u5c5e\u6027\u4fee\u6539\u4e3a block \u6216 flex\u3002\u8fd9\u6837\uff0c\u5b50\u76d2\u5b50\u5c06\u4f5c\u4e3a\u5757\u7ea7\u5143\u7d20\u6216\u5f39\u6027\u76d2\u6a21\u578b\u5143\u7d20\u8fdb\u884c\u6392\u5217\uff0c\u5e76\u4e14\u53ef\u4ee5\u6309\u7167\u9884\u671f\u6a2a\u5411\u6392\u5217\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fHTML \u548c CSS \u4ee3\u7801\u4e2d\uff0c\u4e24\u4e2a\u5b50\u76d2\u5b50\u4e3a\u4ec0\u4e48\u65e0\u6cd5\u6a2a\u5411\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>\u4e3a\u4ec0\u4e48\u4e24\u4e2a\u5b50\u76d2\u65e0\u6cd5\u6a2a\u5411\uff1f \u4ee5\u4e0b html \u548c \u4ee3\u7801\u4e2d\uff0c\u4e24\u4e2a\u5b50\u76d2\u5b50 box1 \u548c box2 \u9884\u671f\u5e94\u8be5\u6a2a\u5411\u6392\u5217\uff0c\u4f46\u5b9e\u9645\u5374\u6ca1\u6709\uff1a &lt;div class=&#8221;container&#8221;&gt; &lt;div class=&#8221;box1&#8243;&gt;&lt;\/div&gt; &lt;div class=&#8221;box2&#8243;&gt;&lt;\/div&gt; &lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 * { box-sizing: border-box; padding: 0; margin: 0; } .container { height: 300px; width: 500px; } .box1 { display: inline-flex; width: 50%; height: 100%; background-color: #87CEFA; } .box2 { display: inline-flex; height: 100%; width: 50%; background-color: #FFC0CB; } [&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-1236","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1236","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=1236"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1236\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}