{"id":2775,"date":"2024-11-10T08:59:14","date_gmt":"2024-11-10T00:59:14","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2775\/"},"modified":"2024-11-10T08:59:14","modified_gmt":"2024-11-10T00:59:14","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-flexbox-%e5%b8%83%e5%b1%80%e5%ae%9e%e7%8e%b0%e5%ae%bd%e5%ba%a6%e4%b8%8d%e5%ae%9a%e3%80%81%e9%97%b4%e8%b7%9d%e7%9b%b8%e5%90%8c%e5%92%8c%e5%b7%a6%e5%af%b9%e9%bd%90","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2775\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Flexbox \u5e03\u5c40\u5b9e\u73b0\u5bbd\u5ea6\u4e0d\u5b9a\u3001\u95f4\u8ddd\u76f8\u540c\u548c\u5de6\u5bf9\u9f50\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173087699459031.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 Flexbox \u5e03\u5c40\u5b9e\u73b0\u5bbd\u5ea6\u4e0d\u5b9a\u3001\u95f4\u8ddd\u76f8\u540c\u548c\u5de6\u5bf9\u9f50\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 Flexbox \u5e03\u5c40\u5b9e\u73b0\u5bbd\u5ea6\u4e0d\u5b9a\u3001\u95f4\u8ddd\u76f8\u540c\u548c\u5de6\u5bf9\u9f50\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5b9e\u73b0\u5bbd\u5ea6\u4e0d\u5b9a\u3001\u95f4\u8ddd\u76f8\u540c\u548c\u5de6\u5bf9\u9f50\u5e03\u5c40<\/strong><\/p>\n<p>\u5bf9\u4e8e\u5e03\u5c40\u7684\u9700\u6c42\u662f\uff1a\u5185\u5bb9\u5bbd\u5ea6\u53ef\u53d8\uff0c\u4f46\u5f7c\u6b64\u4e4b\u95f4\u8981\u4fdd\u6301\u76f8\u540c\u7684\u95f4\u8ddd\uff0c\u5e76\u4e14\u8981\u5de6\u5bf9\u9f50\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u6837\u7684\u5e03\u5c40\uff0c\u53ef\u4ee5\u4f7f\u7528\u5f39\u6027\u76d2\u6a21\u578b\uff08flexbox\uff09\u3002<\/p>\n<p><strong>flexbox \u5e03\u5c40<\/strong><\/p>\n<p>flexbox \u5e03\u5c40\u662f\u4e00\u79cd\u4e00\u7ef4\u5e03\u5c40\u6a21\u578b\uff0c\u5b83\u5141\u8bb8\u5143\u7d20\u6cbf\u4e3b\u8981\u8f74\u548c\u4ea4\u53c9\u8f74\u7684\u65b9\u5411\u3002\u4f7f\u7528 flexbox\uff0c\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u5177\u6709\u52a8\u6001\u5927\u5c0f\u548c\u95f4\u8ddd\u7684\u590d\u6742\u5e03\u5c40\u3002<\/p>\n<p><strong> \u4ee3\u7801<\/strong><\/p>\n<p>\u8981\u5b9e\u73b0\u6240\u63cf\u8ff0\u7684\u5e03\u5c40\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b css \u4ee3\u7801\uff1a<\/p>\n<pre>display: flex;\nflex-wrap: wrap;\ngap: 10px;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li> <strong>display: flex;<\/strong>\uff1a\u5c06\u5143\u7d20\u8f6c\u6362\u4e3a flexbox \u5e03\u5c40\u3002<\/li>\n<li> <strong>flex-wrap: wrap;<\/strong>\uff1a\u5141\u8bb8\u5143\u7d20\u5728\u8fbe\u5230\u5bb9\u5668\u8fb9\u7f18\u65f6\u6362\u884c\u3002<\/li>\n<li> <strong>gap: 10px;<\/strong>\uff1a\u8bbe\u7f6e\u5143\u7d20\u4e4b\u95f4\u7684\u95f4\u8ddd\u3002<\/li>\n<\/ul>\n<p>\u4f7f\u7528\u6b64\u4ee3\u7801\uff0c\u5143\u7d20\u5c06\u5de6\u5bf9\u9f50\uff0c\u5bbd\u5ea6\u4e0d\u5b9a\uff0c\u5e76\u4fdd\u6301 10px \u7684\u95f4\u8ddd\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 Flexbox \u5e03\u5c40\u5b9e\u73b0\u5bbd\u5ea6\u4e0d\u5b9a\u3001\u95f4\u8ddd\u76f8\u540c\u548c\u5de6\u5bf9\u9f50\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>\u5b9e\u73b0\u5bbd\u5ea6\u4e0d\u5b9a\u3001\u95f4\u8ddd\u76f8\u540c\u548c\u5de6\u5bf9\u9f50\u5e03\u5c40 \u5bf9\u4e8e\u5e03\u5c40\u7684\u9700\u6c42\u662f\uff1a\u5185\u5bb9\u5bbd\u5ea6\u53ef\u53d8\uff0c\u4f46\u5f7c\u6b64\u4e4b\u95f4\u8981\u4fdd\u6301\u76f8\u540c\u7684\u95f4\u8ddd\uff0c\u5e76\u4e14\u8981\u5de6\u5bf9\u9f50\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u6837\u7684\u5e03\u5c40\uff0c\u53ef\u4ee5\u4f7f\u7528\u5f39\u6027\u76d2\u6a21\u578b\uff08flexbox\uff09\u3002 flexbox \u5e03\u5c40 flexbox \u5e03\u5c40\u662f\u4e00\u79cd\u4e00\u7ef4\u5e03\u5c40\u6a21\u578b\uff0c\u5b83\u5141\u8bb8\u5143\u7d20\u6cbf\u4e3b\u8981\u8f74\u548c\u4ea4\u53c9\u8f74\u7684\u65b9\u5411\u3002\u4f7f\u7528 flexbox\uff0c\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u5177\u6709\u52a8\u6001\u5927\u5c0f\u548c\u95f4\u8ddd\u7684\u590d\u6742\u5e03\u5c40\u3002 \u4ee3\u7801 \u8981\u5b9e\u73b0\u6240\u63cf\u8ff0\u7684\u5e03\u5c40\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b css \u4ee3\u7801\uff1a display: flex; flex-wrap: wrap; gap: 10px; \u767b\u5f55\u540e\u590d\u5236 display: flex;\uff1a\u5c06\u5143\u7d20\u8f6c\u6362\u4e3a flexbox \u5e03\u5c40\u3002 flex-wrap: wrap;\uff1a\u5141\u8bb8\u5143\u7d20\u5728\u8fbe\u5230\u5bb9\u5668\u8fb9\u7f18\u65f6\u6362\u884c\u3002 gap: 10px;\uff1a\u8bbe\u7f6e\u5143\u7d20\u4e4b\u95f4\u7684\u95f4\u8ddd\u3002 \u4f7f\u7528\u6b64\u4ee3\u7801\uff0c\u5143\u7d20\u5c06\u5de6\u5bf9\u9f50\uff0c\u5bbd\u5ea6\u4e0d\u5b9a\uff0c\u5e76\u4fdd\u6301 10px \u7684\u95f4\u8ddd\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 Flexbox \u5e03\u5c40\u5b9e\u73b0\u5bbd\u5ea6\u4e0d\u5b9a\u3001\u95f4\u8ddd\u76f8\u540c\u548c\u5de6\u5bf9\u9f50\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-2775","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2775","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=2775"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2775\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}