{"id":2014,"date":"2024-11-10T17:33:34","date_gmt":"2024-11-10T09:33:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2014\/"},"modified":"2024-11-10T17:33:34","modified_gmt":"2024-11-10T09:33:34","slug":"%e5%a6%82%e4%bd%95%e8%ae%a9%e7%88%b6%e5%ae%b9%e5%99%a8%e5%86%85%e6%b0%b4%e5%b9%b3%e6%8e%92%e5%88%97%e7%9a%84div%e4%bf%9d%e6%8c%81%e4%b8%80%e8%87%b4%e9%ab%98%e5%ba%a6%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2014\/","title":{"rendered":"\u5982\u4f55\u8ba9\u7236\u5bb9\u5668\u5185\u6c34\u5e73\u6392\u5217\u7684DIV\u4fdd\u6301\u4e00\u81f4\u9ad8\u5ea6\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173062998486119.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u8ba9\u7236\u5bb9\u5668\u5185\u6c34\u5e73\u6392\u5217\u7684DIV\u4fdd\u6301\u4e00\u81f4\u9ad8\u5ea6\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u8ba9\u7236\u5bb9\u5668\u5185\u6c34\u5e73\u6392\u5217\u7684DIV\u4fdd\u6301\u4e00\u81f4\u9ad8\u5ea6\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u7236\u5bb9\u5668\u5185div\u6c34\u5e73\u5e76\u4fdd\u6301\u76f8\u540c\u9ad8\u5ea6\uff0c\u4e0d\u53d7\u5185\u5bb9\u5f71\u54cd<\/strong><\/p>\n<p>\u8981\u5728\u7236\u5bb9\u5668\u5185\u5c06\u6240\u6709 DIV \u6a2a\u5411\u6392\u5217\uff0c\u5e76\u4f7f\u5b83\u4eec\u65e0\u8bba\u5185\u5bb9\u5927\u5c0f\u90fd\u4fdd\u6301\u76f8\u540c\u7684\u9ad8\u5ea6\uff0c\u53ef\u4ee5\u4f7f\u7528 CSS flex \u5e03\u5c40\u3002<\/p>\n<pre>.flex {\n  display: flex;\n  flex-direction: row;\n  align-items: stretch;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u8fd9\u79cd\u65b9\u5f0f\u8bbe\u7f6e\u7236\u5bb9\u5668\u540e\uff0c\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709 DIV \u90fd\u4f1a\u81ea\u52a8\u62c9\u4f38\u4ee5\u5339\u914d\u6700\u9ad8 DIV \u7684\u9ad8\u5ea6\u3002\u5373\u4f7f\u67d0\u4e9b DIV \u7684\u5185\u5bb9\u8f83\u5c11\uff0c\u5b83\u4eec\u7684\u9ad8\u5ea6\u4e5f\u4f1a\u8c03\u6574\u4e3a\u4e0e\u6700\u9ad8 DIV \u76f8\u540c\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u4ee5\u4e0b HTML \u7ed3\u6784\uff1a<\/p>\n<pre>&lt;div class=\"flex\"&gt;\n  &lt;div&gt;\u8f83\u77ed\u7684\u5185\u5bb9&lt;\/div&gt;\n  &lt;div&gt;\u8f83\u957f\u4e14\u5305\u542b\u591a\u4e2a\u6bb5\u843d\u7684\u5185\u5bb9&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06\u4ea7\u751f\u4ee5\u4e0b\u7ed3\u679c\uff1a<\/p>\n<p>[\u56fe\u7247\u5c55\u793a DIV \u6309\u7167\u5e03\u5c40\u6392\u5217\uff0c\u9ad8\u5ea6\u4e00\u81f4]<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u8ba9\u7236\u5bb9\u5668\u5185\u6c34\u5e73\u7684DIV\u4fdd\u6301\u4e00\u81f4\u9ad8\u5ea6\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>\u7236\u5bb9\u5668\u5185div\u6c34\u5e73\u5e76\u4fdd\u6301\u76f8\u540c\u9ad8\u5ea6\uff0c\u4e0d\u53d7\u5185\u5bb9\u5f71\u54cd \u8981\u5728\u7236\u5bb9\u5668\u5185\u5c06\u6240\u6709 DIV \u6a2a\u5411\u6392\u5217\uff0c\u5e76\u4f7f\u5b83\u4eec\u65e0\u8bba\u5185\u5bb9\u5927\u5c0f\u90fd\u4fdd\u6301\u76f8\u540c\u7684\u9ad8\u5ea6\uff0c\u53ef\u4ee5\u4f7f\u7528 CSS flex \u5e03\u5c40\u3002 .flex { display: flex; flex-direction: row; align-items: stretch; } \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u8fd9\u79cd\u65b9\u5f0f\u8bbe\u7f6e\u7236\u5bb9\u5668\u540e\uff0c\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709 DIV \u90fd\u4f1a\u81ea\u52a8\u62c9\u4f38\u4ee5\u5339\u914d\u6700\u9ad8 DIV \u7684\u9ad8\u5ea6\u3002\u5373\u4f7f\u67d0\u4e9b DIV \u7684\u5185\u5bb9\u8f83\u5c11\uff0c\u5b83\u4eec\u7684\u9ad8\u5ea6\u4e5f\u4f1a\u8c03\u6574\u4e3a\u4e0e\u6700\u9ad8 DIV \u76f8\u540c\u3002 \u4f8b\u5982\uff0c\u4ee5\u4e0b HTML \u7ed3\u6784\uff1a &lt;div class=&#8221;flex&#8221;&gt; &lt;div&gt;\u8f83\u77ed\u7684\u5185\u5bb9&lt;\/div&gt; &lt;div&gt;\u8f83\u957f\u4e14\u5305\u542b\u591a\u4e2a\u6bb5\u843d\u7684\u5185\u5bb9&lt;\/div&gt; &lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 \u5c06\u4ea7\u751f\u4ee5\u4e0b\u7ed3\u679c\uff1a [\u56fe\u7247\u5c55\u793a DIV \u6309\u7167\u5e03\u5c40\u6392\u5217\uff0c\u9ad8\u5ea6\u4e00\u81f4] \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u8ba9\u7236\u5bb9\u5668\u5185\u6c34\u5e73\u7684DIV\u4fdd\u6301\u4e00\u81f4\u9ad8\u5ea6\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2014","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2014","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=2014"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2014\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}