{"id":53580,"date":"2024-12-03T17:11:51","date_gmt":"2024-12-03T09:11:51","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53580\/"},"modified":"2024-12-03T17:11:51","modified_gmt":"2024-12-03T09:11:51","slug":"flex-%e5%b8%83%e5%b1%80%e4%b8%8b-overflow-%e6%97%a0%e6%95%88%ef%bc%9f%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53580\/","title":{"rendered":"Flex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Flex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f <\/h1>\n<p>IT\u884c\u4e1a\u76f8\u5bf9\u4e8e\u4e00\u822c\u4f20\u7edf\u884c\u4e1a\uff0c\u53d1\u5c55\u66f4\u65b0\u901f\u5ea6\u66f4\u5feb\uff0c\u4e00\u65e6\u505c\u6b62\u4e86\u5b66\u4e60\uff0c\u5f88\u5feb\u5c31\u4f1a\u88ab\u884c\u4e1a\u6240\u6dd8\u6c70\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8e0f\u8e0f\u5b9e\u5b9e\u7684\u4e0d\u65ad\u5b66\u4e60\uff0c\u7cbe\u8fdb\u81ea\u5df1\u7684\u6280\u672f\uff0c\u5c24\u5176\u662f\u521d\u5b66\u8005\u3002\u4eca\u5929\u7c73\u4e91\u7ed9\u5927\u5bb6\u6574\u7406\u4e86\u300aFlex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f \u300b\uff0c\u804a\u804a\uff0c\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241202\/1733113491674d3693924b8.jpg\" class=\"aligncenter\" title=\"Flex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"Flex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>Flex \u5e03\u5c40\u4e0b overflow \u5931\u6548\u7684\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u5728 Flex \u5e03\u5c40\u4e2d\u9047\u5230 overflow \u5931\u6548\u95ee\u9898\u65f6\uff0c\u9700\u8981\u8003\u8651\u4ee5\u4e0b\u56e0\u7d20\uff1a<\/p>\n<p><strong>\u5185\u5bb9\u8d85\u51fa\u5bb9\u5668\uff1a<\/strong><br \/>overflow \u7684\u4e00\u4e2a\u89e6\u53d1\u6761\u4ef6\u662f\u5185\u5bb9\u8d85\u51fa\u5bb9\u5668\u3002\u56e0\u6b64\uff0c\u5982\u679c\u7b2c\u4e00\u4e2a div \u6ca1\u6709\u8bbe\u7f6e\u9ad8\u5ea6\u6216\u6700\u5927\u9ad8\u5ea6\uff0c\u5b83\u53ef\u80fd\u65e0\u6cd5\u89e6\u53d1 overflow\u3002<\/p>\n<p><strong>\u8bbe\u7f6e\u5bb9\u5668\u9ad8\u5ea6\uff1a<\/strong><br \/>\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u8bf7\u786e\u4fdd\u4e3a\u5916\u5c42\u5bb9\u5668\uff08\u5728\u4f60\u7684\u793a\u4f8b\u4e2d\u662f\u672a\u6807\u8bb0\u7684\uff0c\u4f46\u62e5\u6709 flex-direction:column\uff09\u8bbe\u7f6e\u4e00\u4e2a\u9ad8\u5ea6\u6216\u6700\u5927\u9ad8\u5ea6\u3002\u4f7f\u7528 vh\uff08\u89c6\u53e3\u9ad8\u5ea6\uff09\u5355\u4f4d\u53ef\u80fd\u662f\u660e\u667a\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u968f\u7740\u89c6\u53e3\u5927\u5c0f\u7684\u53d8\u5316\u800c\u52a8\u6001\u8c03\u6574\u3002<\/p>\n<p><strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre>.wrapper {\n  \/* \u8bbe\u7f6e\u5bb9\u5668\u9ad8\u5ea6\u6216\u6700\u5927\u9ad8\u5ea6 *\/\n  height: 40vh;\n}<\/pre>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u8bbe\u7f6e\uff0c\u7b2c\u4e00\u4e2a div \u7684\u5185\u5bb9\u8d85\u51fa\u5bb9\u5668\u540e\uff0c\u5b83\u5c06\u89e6\u53d1 overflow-scroll\uff0c\u5141\u8bb8\u7528\u6237\u6eda\u52a8\u6d4f\u89c8\u6ea2\u51fa\u5185\u5bb9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u300aFlex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f \u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8e\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u638c\u63e1\u6700\u5b9e\u7528\u7684\u7535\u8111\u5feb\u6377\u952e\uff0c\u63d0\u5347\u5de5\u4f5c\u6548\u7387\u7684\u5fc5\u5907\u77e5\u8bc6\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Flex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f IT\u884c\u4e1a\u76f8\u5bf9\u4e8e\u4e00\u822c\u4f20\u7edf\u884c\u4e1a\uff0c\u53d1\u5c55\u66f4\u65b0\u901f\u5ea6\u66f4\u5feb\uff0c\u4e00\u65e6\u505c\u6b62\u4e86\u5b66\u4e60\uff0c\u5f88\u5feb\u5c31\u4f1a\u88ab\u884c\u4e1a\u6240\u6dd8\u6c70\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8e0f\u8e0f\u5b9e\u5b9e\u7684\u4e0d\u65ad\u5b66\u4e60\uff0c\u7cbe\u8fdb\u81ea\u5df1\u7684\u6280\u672f\uff0c\u5c24\u5176\u662f\u521d\u5b66\u8005\u3002\u4eca\u5929\u7c73\u4e91\u7ed9\u5927\u5bb6\u6574\u7406\u4e86\u300aFlex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f \u300b\uff0c\u804a\u804a\uff0c\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01 Flex \u5e03\u5c40\u4e0b overflow \u5931\u6548\u7684\u89e3\u51b3\u65b9\u6848 \u5728 Flex \u5e03\u5c40\u4e2d\u9047\u5230 overflow \u5931\u6548\u95ee\u9898\u65f6\uff0c\u9700\u8981\u8003\u8651\u4ee5\u4e0b\u56e0\u7d20\uff1a \u5185\u5bb9\u8d85\u51fa\u5bb9\u5668\uff1aoverflow \u7684\u4e00\u4e2a\u89e6\u53d1\u6761\u4ef6\u662f\u5185\u5bb9\u8d85\u51fa\u5bb9\u5668\u3002\u56e0\u6b64\uff0c\u5982\u679c\u7b2c\u4e00\u4e2a div \u6ca1\u6709\u8bbe\u7f6e\u9ad8\u5ea6\u6216\u6700\u5927\u9ad8\u5ea6\uff0c\u5b83\u53ef\u80fd\u65e0\u6cd5\u89e6\u53d1 overflow\u3002 \u8bbe\u7f6e\u5bb9\u5668\u9ad8\u5ea6\uff1a\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u8bf7\u786e\u4fdd\u4e3a\u5916\u5c42\u5bb9\u5668\uff08\u5728\u4f60\u7684\u793a\u4f8b\u4e2d\u662f\u672a\u6807\u8bb0\u7684\uff0c\u4f46\u62e5\u6709 flex-direction:column\uff09\u8bbe\u7f6e\u4e00\u4e2a\u9ad8\u5ea6\u6216\u6700\u5927\u9ad8\u5ea6\u3002\u4f7f\u7528 vh\uff08\u89c6\u53e3\u9ad8\u5ea6\uff09\u5355\u4f4d\u53ef\u80fd\u662f\u660e\u667a\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u968f\u7740\u89c6\u53e3\u5927\u5c0f\u7684\u53d8\u5316\u800c\u52a8\u6001\u8c03\u6574\u3002 \u4ee3\u7801\u793a\u4f8b\uff1a .wrapper { \/* \u8bbe\u7f6e\u5bb9\u5668\u9ad8\u5ea6\u6216\u6700\u5927\u9ad8\u5ea6 *\/ height: 40vh; } \u901a\u8fc7\u8fd9\u4e9b\u8bbe\u7f6e\uff0c\u7b2c\u4e00\u4e2a div \u7684\u5185\u5bb9\u8d85\u51fa\u5bb9\u5668\u540e\uff0c\u5b83\u5c06\u89e6\u53d1 overflow-scroll\uff0c\u5141\u8bb8\u7528\u6237\u6eda\u52a8\u6d4f\u89c8\u6ea2\u51fa\u5185\u5bb9\u3002 \u4ee5\u4e0a\u5c31\u662f\u300aFlex \u5e03\u5c40\u4e0b overflow \u65e0\u6548\uff1f\u5982\u4f55\u89e3\u51b3\uff1f \u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8e\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01 \u638c\u63e1\u6700\u5b9e\u7528\u7684\u7535\u8111\u5feb\u6377\u952e\uff0c\u63d0\u5347\u5de5\u4f5c\u6548\u7387\u7684\u5fc5\u5907\u77e5\u8bc6<\/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-53580","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53580","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=53580"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53580\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}