{"id":8436,"date":"2019-01-31T01:13:39","date_gmt":"2019-01-30T17:13:39","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8436"},"modified":"2020-05-07T00:55:05","modified_gmt":"2020-05-06T16:55:05","slug":"css-css3-columns-layout","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2019\/01\/css-css3-columns-layout\/","title":{"rendered":"\u5199\u7ed9\u81ea\u5df1\u770b\u7684CSS columns\u5206\u680f\u5e03\u5c40\u6559\u7a0b"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8436\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=8436<\/a><br \/>\n\u672c\u6587\u53ef\u5168\u6587\u8f6c\u8f7d\uff0c\u4e2a\u4eba\u7f51\u7ad9\u65e0\u9700\u6388\u6743\uff0c\u53ea\u8981\u4fdd\u7559\u539f\u4f5c\u8005\u3001\u51fa\u5904\u4ee5\u53ca\u6587\u4e2d\u94fe\u63a5\u5373\u53ef\uff0c\u4efb\u4f55\u7f51\u7ad9\u5747\u53ef\u6458\u8981\u805a\u5408\uff0c\u5546\u7528\u8bf7\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<p><script>window.wxShareImgUrl = 'https:\/\/www.zhangxinxu.com\/study\/image\/share\/201901-columns.jpg';<\/script><\/p>\n<link rel=\"stylesheet\" href=\"\/study\/201901\/columns.css?v=1\">\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201810\/flex-thumb.jpg\" width=\"484\" height=\"300\" class=\"alignright clip size-medium\" alt=\"columns\u5e03\u5c40\"><\/p>\n<h3>\u4e00\u3001\u524d\u8a00&amp;\u7d22\u5f15<\/h3>\n<p>Multiple-column\u5e03\u5c40\uff0c\u4e5f\u79f0\u591a\u5217\u5e03\u5c40\u3001\u591a\u680f\u5e03\u5c40\uff0c\u6211\u81ea\u5df1\u559c\u6b22\u53eb\u505a\u5206\u680f\u5e03\u5c40\uff0c\u8fd9\u79cd\u5e03\u5c40\u53ef\u4ee5\u8bb2\u5185\u5bb9\u5e03\u5c40\u5230\u4e00\u7ec4\u5217\u6846\uff0c\u7c7b\u4f3c\u4e8e\u62a5\u7eb8\u4e0a\u7684\u6392\u7248\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201901\/columns-s.jpg\" width=\"200\" height=\"139\" alt=\"\u62a5\u7eb8\u5206\u680f\u6392\u7248\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u5206\u680f\u5e03\u5c40\u975e\u5e38\u7279\u6b8a\uff0c\u6709\u522b\u4e8e\u4f20\u7edf\u5e03\u5c40\u65b9\u6cd5\uff0c\u5b83\u5c06\u5305\u62ec\u5305\u62ec\u6240\u6709\u5b50\u5143\u7d20\u5728\u5185\u7684\u6240\u6709\u5185\u5bb9\u62c6\u5206\u4e3a\u5217\uff0c\u8fd9\u4e0e\u6211\u4eec\u6253\u5370\u7f51\u9875\u65f6\u5019\u65f6\u9875\u9762\u5185\u5bb9\u5206\u5272\u6210\u4e0d\u540c\u7684\u9875\u9762\u7684\u65b9\u5f0f\u7c7b\u4f3c\u3002<\/p>\n<p>\u5206\u680f\u5e03\u5c40IE10+\u90fd\u53ef\u4ee5\u4f7f\u7528\uff0cAPI\u7a33\u5b9a\uff0c\u79fb\u52a8\u7aef\u517c\u5bb9\u6027\u6bd4flex\u5e03\u5c40\u8981\u597d\uff0c\u867d\u7136\u8bbe\u8ba1\u521d\u8877\u4e0d\u4e00\u6837\uff0c\u4f46\u5f88\u591a\u5e03\u5c40\u90fd\u53ef\u4ee5\u5b9e\u73b0\u3002\u751a\u81f3\u67d0\u4e9b\u573a\u666f\u4e0b\uff0c\u53ea\u80fd\u4f7f\u7528\u5206\u680f\u5e03\u5c40\u624d\u80fd\u5b9e\u73b0\u3002\u5f88\u6709\u5b66\u4e60\u7684\u5fc5\u8981\u3002<\/p>\n<p>\u4e0e\u5206\u680f\u5e03\u5c40\u76f8\u5173\u7684CSS\u5c5e\u6027\u5305\u62ec\uff1a<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\" style=\"max-width:400px;\">\n<thead>\n<tr>\n<th>\u76f4\u63a5\u76f8\u5173\u5c5e\u6027<\/th>\n<th>\u95f4\u63a5\u76f8\u5173\u5c5e\u6027<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"vertical-align: top;\">\n<ul>\n<li><a href=\"#column-width\" title=\"\">column-width<\/a><\/li>\n<li><a href=\"#column-count\" title=\"\">column-count<\/a><\/li>\n<li><a href=\"#columns\" title=\"\">columns<\/a><\/li>\n<li><a href=\"#column-rule-color\" title=\"\">column-rule-color<\/a><\/li>\n<li><a href=\"#column-rule-style\" title=\"\">column-rule-style<\/a><\/li>\n<li><a href=\"#column-rule-width\" title=\"\">column-rule-width<\/a><\/li>\n<li><a href=\"#column-rule\" title=\"\">column-rule<\/a><\/li>\n<li><a href=\"#column-span\" title=\"\">column-span<\/a><\/li>\n<li><a href=\"#column-fill\" title=\"\">column-fill<\/a><\/li>\n<li><a href=\"#column-gap\" title=\"\">column-gap<\/a><\/li>\n<\/ul>\n<\/td>\n<td style=\"vertical-align: top;\">\n<ul>\n<li><a href=\"#break-after\" title=\"\">break-after<\/a><\/li>\n<li><a href=\"#break-before\" title=\"\">break-before<\/a><\/li>\n<li><a href=\"#break-inside\" title=\"\">break-inside<\/a><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e8c\u3001\u76f4\u63a5\u76f8\u5173CSS\u5c5e\u6027<\/h3>\n<h4 id=\"column-width\">1. column-width<\/h4>\n<p><code>column-width<\/code>\u8868\u793a\u6bcf\u4e00\u680f\/\u5217\u7684\u6700\u4f73\u5bbd\u5ea6\u3002<\/p>\n<p>\u5982\u679c\u6211\u4eec\u53ea\u8bbe\u5b9a<code>column-width<\/code>\uff0c\u6d4f\u89c8\u5668\u4f1a\u81ea\u52a8\u6839\u636e\u73b0\u6709\u5bb9\u5668\u5bbd\u5ea6\u5212\u5206\u680f\u76ee\u7684\u4e2a\u6570\u3002<\/p>\n<p><strong>\u8bed\u6cd5\u5982\u4e0b\uff1a<\/strong><\/p>\n<pre>column-width: &lt;length&gt; | auto;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>&lt;length&gt;<\/strong><\/dt>\n<dd>\u8868\u793a\u8bbe\u5b9a\u7684\u6700\u4f73\u5217\u5bbd\u503c\u3002\u5b9e\u9645\u5448\u73b0\u7684\u6bcf\u4e00\u680f\u7684\u5bbd\u5ea6\u53ef\u80fd\u4e0e\u6307\u5b9a\u503c\u4e0d\u540c\uff0c\u5177\u4f53\u5185\u5bb9\u53c2\u89c1\u4e0b\u9762\u7684\u7ec6\u8282\u63cf\u8ff0\u3002<\/dd>\n<dt><strong>auto<\/strong><\/dt>\n<dd>\u9ed8\u8ba4\u503c\u3002\u8868\u793a\u6bcf\u4e00\u680f\u7684\u5bbd\u5ea6\u7531\u5176\u5b83CSS\u5c5e\u6027\u51b3\u5b9a\uff0c\u4f8b\u5982<code><a href=\"#column-count\">column-count<\/a><\/code>\u3002<\/dd>\n<\/dl>\n<p><strong>\u4e00\u4e9b\u7ec6\u8282\uff1a<\/strong><\/p>\n<ol>\n<li><code>column-width<\/code>\u6709\u65f6\u5019\u4f1a\u65e0\u6548\u3002\u4f8b\u5982\u5bb9\u5668\u5bbd\u5ea6400\u50cf\u7d20\uff0c\u8bbe\u5b9a\u7684\u6bcf\u4e00\u680f\u5bbd\u5ea6\u662f300\u50cf\u7d20\uff0c\u4e0d\u8db3\u4ee5\u5206\u680f\uff0c\u6b64\u65f6\u5185\u5bb9\u586b\u5145\u586b\u5145\u8868\u73b0\u4e3a\u5145\u5206\u5229\u7528\u53ef\u7528\u7a7a\u95f4\uff0c\u6700\u7ec8\u5448\u73b0\u7684\u5217\u5bbd\u6bd4\u8bbe\u5b9a\u7684\u66f4\u5bbd\u3002\u53c8\u4f8b\u5982\u5bb9\u5668\u5bbd\u5ea6400\u50cf\u7d20\uff0c<code>column-width<\/code>\u8bbe\u7f6e\u4e3a500\u50cf\u7d20\uff0c\u5219\u6700\u7ec8\u5206\u680f\u5bbd\u5ea6\u4e0d\u4f1a\u8d85\u8fc7\u5bb9\u5668\u5bbd\u5ea6\uff0c\u6bd4\u8bbe\u5b9a\u7684500\u50cf\u7d20\u8981\u5c0f\u3002<\/li>\n<li><code>column-width<\/code>\u4e0d\u652f\u6301\u8d1f\u503c\uff0c\u4e5f\u4e0d\u652f\u6301\u767e\u5206\u6bd4\u503c\u3002<\/li>\n<\/ol>\n<p><strong>\u5b9e\u5730\u6f14\u793a\uff1a<\/strong><\/p>\n<p>\u70b9\u51fb\u4e0b\u9762\u7684\u9009\u9879\u5361\uff0c\u611f\u53d7\u4e0b\u4e0d\u540c<code>column-width<\/code>\u5c5e\u6027\u503c\u4e0b\u7684\u5e03\u5c40\u8868\u73b0\uff1a<\/p>\n<div class=\"cmn-box\"><input type=\"radio\" id=\"colWidth1\" class=\"cmn-radio-1 cmn-width-1\" name=\"colTest1\" checked><input type=\"radio\" id=\"colWidth2\" class=\"cmn-radio-2 cmn-width-2\" name=\"colTest1\"><input type=\"radio\" id=\"colWidth3\" class=\"cmn-radio-3 cmn-width-3\" name=\"colTest1\"><input type=\"radio\" id=\"colWidth4\" class=\"cmn-radio-4 cmn-width-4\" name=\"colTest1\"><\/p>\n<div class=\"cmn-tab\"><label for=\"colWidth1\" class=\"cmn-tab-li\">column-width:auto<\/label><label for=\"colWidth2\" class=\"cmn-tab-li\">column-width:8%<small style=\"color:red;\">\uff08\u65e0\u6548\uff09<\/small><\/label><label for=\"colWidth3\" class=\"cmn-tab-li\">column-width:80px<\/label><label for=\"colWidth4\" class=\"cmn-tab-li\">column-width:8em<\/label><\/div>\n<div class=\"cmn-content\">\n<p style=\"margin-top: 0;\">CSS <code>column-width<\/code>\u5c5e\u6027\u6307\u5b9a\u591a\u5217\u5e03\u5c40\u4e2d\u7684\u7406\u60f3\u5217\u5bbd\u3002\u5bb9\u5668\u5c06\u5177\u6709\u5c3d\u53ef\u80fd\u591a\u7684\u5217\uff0c\u5176\u4e2d\u4efb\u4f55\u4e00\u5217\u7684\u5bbd\u5ea6\u90fd\u4e0d\u5c0f\u4e8e\u5217\u5bbd\u503c\u3002\u5982\u679c\u5bb9\u5668\u7684\u5bbd\u5ea6\u5c0f\u4e8e\u6307\u5b9a\u503c\uff0c\u5219\u5355\u5217\u7684\u5bbd\u5ea6\u5c06\u5c0f\u4e8e\u58f0\u660e\u7684\u5217\u5bbd\u3002<\/p>\n<p style=\"margin-bottom: 0;\">\u6b64\u5c5e\u6027\u53ef\u4ee5\u5e2e\u52a9\u60a8\u521b\u5efa\u9002\u5408\u4e0d\u540c\u5c4f\u5e55\u5927\u5c0f\u7684\u54cd\u5e94\u5f0f\u8bbe\u8ba1\u3002\u5c24\u5176\u662f\u5728<code>column-count<\/code>\u5c5e\u6027\uff08\u5177\u6709\u4f18\u5148\u6743\uff09\u5b58\u5728\u7684\u60c5\u51b5\u4e0b\uff0c\u5fc5\u987b\u6307\u5b9a\u6240\u6709\u76f8\u5173\u7684\u957f\u5ea6\u503c\u4ee5\u83b7\u5f97\u7cbe\u786e\u7684\u5217\u5bbd\u5ea6\u3002\u5728\u6c34\u5e73\u6587\u672c\u4e2d\uff0c\u8fd9\u4e9b\u957f\u5ea6\u503c\u5305\u62ec<code>width<\/code>\u3001<code>column-width<\/code>\u3001<code>column-gap<\/code>\uff0c\u4ee5\u53ca<code>column-rule-width<\/code>\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<h4 id=\"column-count\">2. column-count<\/h4>\n<p><code>column-count<\/code>\u8868\u793a\u7406\u60f3\u7684\u5206\u680f\u6570\u76ee\u3002<\/p>\n<p><strong>\u8bed\u6cd5\u5982\u4e0b\uff1a<\/strong><\/p>\n<pre>column-count: &lt;integer&gt; | auto;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>&lt;integer&gt;<\/strong><\/dt>\n<dd>\u8868\u793a\u5206\u680f\u6570\u76ee\uff0c\u6574\u6570\u503c\u3002<\/dd>\n<dt><strong>auto<\/strong><\/dt>\n<dd>\u9ed8\u8ba4\u503c\u3002\u8868\u793a\u5206\u680f\u6570\u76ee\u7531\u5176\u5b83CSS\u5c5e\u6027\u51b3\u5b9a\uff0c\u4f8b\u5982<code><a href=\"#column-width\">column-width<\/a><\/code>\u3002<\/dd>\n<\/dl>\n<p><strong>\u4e00\u4e9b\u7ec6\u8282\uff1a<\/strong><\/p>\n<ol>\n<li><code>column-count<\/code>\u4e0e<code>column-width<\/code>\u90fd\u6709\u53ef\u80fd\u6709\u66f4\u9ad8\u7684\u4f18\u5148\u7ea7\uff0c\u8981\u770b\u5177\u4f53\u573a\u666f\u3002\u4f18\u5148\u7ea7\u8ba1\u7b97\u8bc0\u7a8d\u5c31\u662f\u7edf\u4e00\u8f6c\u6362<code>column-count<\/code>\u503c\uff0c\u54ea\u4e2a\u5c0f\u5c31\u4f7f\u7528\u54ea\u4e00\u4e2a\u3002<\/li>\n<li><code>column-count<\/code>\u4e0d\u652f\u6301\u8d1f\u503c\uff0c\u4e5f\u4e0d\u652f\u6301<code>0<\/code>\u3002<\/li>\n<\/ol>\n<p><strong>\u5b9e\u5730\u6f14\u793a\uff1a<\/strong><\/p>\n<p>\u70b9\u51fb\u4e0b\u9762\u7684\u9009\u9879\u5361\uff0c\u611f\u53d7\u4e0b\u4e0d\u540c<code>column-count<\/code>\u5c5e\u6027\u503c\u4e0b\u7684\u5e03\u5c40\u8868\u73b0\uff1a<\/p>\n<div class=\"cmn-box\"><input type=\"radio\" id=\"colCount1\" class=\"cmn-radio-1 cmn-count-1\" name=\"colTest2\" checked><input type=\"radio\" id=\"colCount2\" class=\"cmn-radio-2 cmn-count-2\" name=\"colTest2\"><input type=\"radio\" id=\"colCount3\" class=\"cmn-radio-3 cmn-count-3\" name=\"colTest2\"><input type=\"radio\" id=\"colCount4\" class=\"cmn-radio-4 cmn-count-4\" name=\"colTest2\"><\/p>\n<div class=\"cmn-tab\"><label for=\"colCount1\" class=\"cmn-tab-li\">column-count:auto<\/label><label for=\"colCount2\" class=\"cmn-tab-li\">column-count:2<\/label><label for=\"colCount3\" class=\"cmn-tab-li\">column-count:2;<br \/>column-width:200px<\/label><label for=\"colCount4\" class=\"cmn-tab-li\">column-count:4;<br \/>column-width:200px<\/label><\/div>\n<div class=\"cmn-content\">\n<p style=\"margin-top: 0;\">\u8fd9\u4e2a\u9009\u9879\u5361\u6d4b\u8bd5\u5207\u6362\u6548\u679c\u5efa\u8bae\u5728PC\u7aef\u6d4f\u89c8\u5668\u4e0a\u4f53\u9a8c\uff0c\u5728\u79fb\u52a8\u7aef\uff0c\u7531\u4e8e\u5bbd\u5ea6\u9650\u5236\u611f\u53d7\u4e0d\u5230\u540e\u4e24\u4e2a\u9009\u9879\u7684\u5dee\u5f02\u3002<\/p>\n<p style=\"margin-bottom: 0;\">\u5728PC\u684c\u9762\u7aef\uff0c\u5bb9\u5668\u5bbd\u5ea6\u5927\u7ea6700\u50cf\u7d20\u51fa\u5934\u4e00\u70b9\uff0c\u6b64\u65f6<code>column-width:200px<\/code>\u6362\u7b97\u6210<code>column-count<\/code>\u5927\u7ea63.6\u7684\u6837\u5b50\u3002\u4e8e\u662f\uff0c\u9009\u9879\u53613\u5206\u6210\u4e862\u680f\uff0c\u56e0\u4e3a<code>column-count:2<\/code>\u503c\u66f4\u5c0f\uff1b\u800c\u9009\u9879\u53614\u7531\u4e8e<code>column-width<\/code>\u6362\u7b97\u503c\u66f4\u5c0f\uff0c\u56e0\u6b64<code>column-width<\/code>\u4f18\u5148\u7ea7\u66f4\u9ad8\uff0c\u6700\u7ec8\u5206\u6210\u4e863\u680f\u663e\u793a\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<p>\u5176\u4e2d\uff0c\u6211\u4eec\u91cd\u70b9\u5173\u6ce8\u9009\u9879\u53613\u548c\u9009\u9879\u53614\u3002\u5728PC\u7b97\uff0c\u7531\u4e8e\u5bb9\u5668\u5bbd\u5ea6\u5927\u7ea6700\u50cf\u7d20\u51fa\u5934\u4e00\u70b9\uff0c\u56e0\u6b64<code>column-width:200px<\/code>\u53ef\u4ee5\u8fd1\u4f3c\u770b\u6210<code>column-count<\/code>\u4e3a3.6\u7684\u6837\u5b50\u3002\u8fd8\u8bb0\u4e0d\u8bb0\u5f97\u4e0a\u9762\u63d0\u5230\u7684\u4f18\u5148\u7ea7\u8ba1\u7b97\u8bc0\u7a8d\uff1a\u54ea\u4e2a\u503c\u5c0f\u54ea\u4e2a\u4f18\u5148\u7ea7\u9ad8\u3002\u4e8e\u662f\uff0c\u9009\u9879\u53613\u5206\u6210\u4e862\u680f\uff0c\u56e0\u4e3a<code>column-count:2<\/code>\u503c\u66f4\u5c0f\uff1b\u800c\u9009\u9879\u53614\u7531\u4e8e<code>column-width<\/code>\u6362\u7b97\u503c\u66f4\u5c0f\uff0c\u56e0\u6b64<code>column-width<\/code>\u4f18\u5148\u7ea7\u66f4\u9ad8\uff0c\u6700\u7ec8\u5206\u6210\u4e863\u680f\u663e\u793a\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u4ece\u4e24\u680f\u6548\u679c\u53ef\u4ee5\u770b\u51fa\uff0ccolumns\u6bcf\u4e00\u4e2a\u680f\u76ee\u7684\u9ad8\u5ea6\u5e76\u4e0d\u603b\u662f\u76f8\u7b49\u7684\uff0c\u5185\u5bb9\u7684\u5206\u5272\u4e5f\u4e0d\u603b\u662f\u5747\u5300\u7684\uff0c\u6d4f\u89c8\u5668\u6709\u4e00\u5957\u81ea\u5df1\u7684\u7b97\u6cd5\u3002<\/p>\n<h4 id=\"columns\">3. columns<\/h4>\n<p><code>columns<\/code>\u662f<code>column-width<\/code>\u548c<code>column-count<\/code>\u5c5e\u6027\u7684\u7f29\u5199\u3002\u4e3e\u51e0\u4e2a\u4f7f\u7528\u7684\u4f8b\u5b50\uff1a<\/p>\n<pre><span style=\"color:green;\">\/* \u680f\u76ee\u5bbd\u5ea6 *\/<\/span>\r\ncolumns: 18em;\r\n\r\n<span style=\"color:green;\">\/* \u680f\u76ee\u6570\u76ee *\/<\/span>\r\ncolumns: auto;\r\ncolumns: 2;\r\n\r\n<span style=\"color:green;\">\/* \u540c\u65f6\u5b9a\u4e49\u5bbd\u5ea6\u548c\u6570\u76ee *\/<\/span>\r\ncolumns: 2 auto;\r\ncolumns: auto 12em;\r\ncolumns: auto auto;<\/pre>\n<p>\u4e0d\u5c55\u5f00\u3002<\/p>\n<h4 id=\"column-rule-color\">4. column-rule-color<\/h4>\n<p><code>column-rule-color<\/code>\u8868\u793a\u6bcf\u4e2a\u680f\u76ee\u4e2d\u95f4\u5206\u9694\u7ebf\u7684\u989c\u8272\u3002<\/p>\n<p><strong>\u8bed\u6cd5\u5982\u4e0b\uff1a<\/strong><\/p>\n<pre>column-rule-color: &lt;color&gt;<\/pre>\n<p>\u652f\u6301\u7684\u5c5e\u6027\u503c\u548c<code>border-color<\/code>\u662f\u4e00\u6a21\u4e00\u6837\u7684\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>column-rule-color: red;\r\ncolumn-rule-color: rgb(255, 0, 0);\r\ncolumn-rule-color: transparent;\r\ncolumn-rule-color: hsla(0, 100%, 50%, 0.5);<\/pre>\n<p>\u9ed8\u8ba4\u503c\u662f\u5f53\u524d<code>color<\/code>\u5c5e\u6027\u7684\u8ba1\u7b97\u503c\u3002<\/p>\n<p><strong>\u5b9e\u4f8b\u5982\u4e0b\uff1a<\/strong><\/p>\n<pre>column-rule-style: dotted;\r\ncolumn-rule-color: red;<\/pre>\n<p>\u5b9e\u65f6\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<div class=\"cmn-box\">\n<div class=\"cmn-content\" style=\"columns: 2; column-rule-style: dotted;column-rule-color: red;\">\n<p style=\"margin: 0;\">\u7531\u4e8e<code>column-rule<\/code>\u9ed8\u8ba4\u7684\u5206\u9694\u7ebf\u7684\u7c7b\u578b\u662f<code>none<\/code>\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u5fc5\u987b\u8981\u6307\u5b9a<code>column-rule-style<\/code>\uff0c\u5426\u5219\u4f1a\u770b\u4e0d\u5230\u5206\u9694\u7ebf\u3002<code>column-rule-*<\/code>\u76f8\u5173\u5c5e\u6027\u503c\u548c<code>border-*<\/code>\u662f\u4e00\u6837\u7684\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<h4 id=\"column-rule-style\">5. column-rule-style<\/h4>\n<p><code>column-rule-style<\/code>\u8868\u793a\u6bcf\u4e2a\u680f\u76ee\u4e2d\u95f4\u5206\u9694\u7ebf\u7684\u7c7b\u578b\u3002\u652f\u6301\u7684\u5c5e\u6027\u503c\u548c<code>border-style<\/code>\u662f\u4e00\u6a21\u4e00\u6837\u7684\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>column-rule-style: none;\r\ncolumn-rule-style: hidden;\r\ncolumn-rule-style: dotted;\r\ncolumn-rule-style: dashed;\r\ncolumn-rule-style: solid;\r\ncolumn-rule-style: double;\r\ncolumn-rule-style: groove;\r\ncolumn-rule-style: ridge;\r\ncolumn-rule-style: inset;\r\ncolumn-rule-style: outset;<\/pre>\n<p>\u6bcf\u4e2a\u5c5e\u6027\u503c\u5177\u4f53\u6548\u679c\u53ef\u4ee5\u70b9\u51fb\u4e0b\u9762\u9009\u9879\u5361\u8fdb\u884c\u4f53\u9a8c\uff1a<\/p>\n<div class=\"cmn-box\"><input type=\"radio\" id=\"colStyle1\" class=\"cmn-radio-1 cmn-style-1\" name=\"colTest3\" checked><input type=\"radio\" id=\"colStyle2\" class=\"cmn-radio-2 cmn-style-2\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle3\" class=\"cmn-radio-3 cmn-style-3\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle4\" class=\"cmn-radio-4 cmn-style-4\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle5\" class=\"cmn-radio-5 cmn-style-5\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle6\" class=\"cmn-radio-6 cmn-style-6\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle7\" class=\"cmn-radio-7 cmn-style-7\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle8\" class=\"cmn-radio-8 cmn-style-8\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle9\" class=\"cmn-radio-9 cmn-style-9\" name=\"colTest3\"><input type=\"radio\" id=\"colStyle10\" class=\"cmn-radio-10 cmn-style-10\" name=\"colTest3\"><\/p>\n<div class=\"cmn-tab cmn-tab-s\"><label for=\"colStyle1\" class=\"cmn-tab-li\">none<\/label><label for=\"colStyle2\" class=\"cmn-tab-li\">hidden<\/label><label for=\"colStyle3\" class=\"cmn-tab-li\">dotted<\/label><label for=\"colStyle4\" class=\"cmn-tab-li\">dashed<\/label><label for=\"colStyle5\" class=\"cmn-tab-li\">solid<\/label><label for=\"colStyle6\" class=\"cmn-tab-li\">double<\/label><label for=\"colStyle7\" class=\"cmn-tab-li\">groove<\/label><label for=\"colStyle8\" class=\"cmn-tab-li\">ridge<\/label><label for=\"colStyle9\" class=\"cmn-tab-li\">inset<\/label><label for=\"colStyle10\" class=\"cmn-tab-li\">outset<\/label><\/div>\n<div class=\"cmn-content\">\n<p style=\"margin-top: 0;\">\u5176\u4e2d<code>dotted<\/code>\u8868\u793a\u865a\u70b9\uff0c<code>dashed<\/code>\u8868\u793a\u865a\u7ebf\uff0c<code>solid<\/code>\u8868\u793a\u5b9e\u7ebf\u3002\u8fd9\u4e09\u4e2a\u6bd4\u8f83\u5e38\u7528\uff0c\u5c31\u4e0d\u591a\u5c55\u5f00\u3002\u7136\u540e\u7740\u91cd\u63d0\u4e0b\u540e\u9762\u51e0\u4e2a\uff0c\u9996\u5148\u662f<code>double<\/code>\uff0c<code>double<\/code>\u8868\u793a<br \/>\n\u53cc\u7ebf\u8fb9\u6846\uff0c\u987e\u540d\u601d\u610f\uff0c\u4e24\u6839\u7ebf\uff0c\u4e14\u4e3a\u5b9e\u7ebf\u3002\u867d\u7136\u5e73\u5e38\u6211\u4eec\u4f7f\u7528\u5c11\uff0c\u4f46\u662f\u517c\u5bb9\u6027\u975e\u5e38\u597d\u3002\u89c6\u89c9\u8868\u73b0\u4e3a\u7ebf\u6846-\u900f\u660e-\u7ebf\u6846\u3002\u5176\u5b83<code>column-rule-style<\/code>\u7c7b\u578b\uff0c\u5982<code>inset<\/code>\uff08\u5185\u51f9\uff09\uff0c<code>outset<\/code>\uff08\u5916\u51f8\uff09\uff0c<code>groove<\/code>\uff08\u6c9f\u69fd\uff09\uff0c<code>ridge<\/code>\uff08\u5c71\u810a\uff09\uff0c\u98ce\u683c\u8001\u571f\u8fc7\u65f6\uff0c\u4e14\u517c\u5bb9\u6027\u60e8\u4e0d\u5fcd\u7779\uff0c\u56e0\u6b64\uff0c\u6ca1\u6709\u4efb\u4f55\u5b9e\u7528\u4ef7\u503c\uff0c\u5927\u5bb6\u65e0\u9700\u5173\u5fc3\u3002<\/p>\n<p style=\"margin-bottom: 0;\">\u79d1\u5b66\u7814\u7a76\u8868\u660e\uff0c\u5bf9\u4e8e\u5927\u591a\u6570\u4eba\u800c\u8a00\uff0c\u65e0\u8bba\u5728\u8fd9\u91cc\u5199\u7684\u662f\u4ec0\u4e48\u6587\u5b57\uff0c\u90fd\u4e0d\u4f1a\u88ab\u8bfb\u8005\u6ce8\u610f\u5230\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<h4 id=\"column-rule-width\">5. column-rule-width<\/h4>\n<p><code>column-rule-width<\/code>\u8868\u793a\u6bcf\u4e2a\u680f\u76ee\u4e2d\u95f4\u5206\u9694\u7ebf\u7684\u5bbd\u5ea6\u5927\u5c0f\u3002\u652f\u6301\u7684\u5c5e\u6027\u503c\u548c<code>border-width<\/code>\u662f\u4e00\u6a21\u4e00\u6837\u7684\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><span style=\"color:green;\">\/* \u5173\u952e\u5b57\u503c *\/<\/span>\r\ncolumn-rule-width: thin;\r\ncolumn-rule-width: medium;  <span style=\"color:green;\">\/* \u9ed8\u8ba4\u503c *\/<\/span>\r\ncolumn-rule-width: thick;\r\n\r\n<span style=\"color:green;\">\/* \u5177\u4f53\u957f\u5ea6\u503c *\/<\/span>\r\ncolumn-rule-width: 1px;\r\ncolumn-rule-width: 2.5em;<\/pre>\n<p>\u6211\u4eec\u5e73\u5e38\u4f7f\u7528<code>column-rule-width<\/code>\u51e0\u4e4e\u5168\u662f\u56fa\u5b9a\u7684\u6570\u503c\uff0c\u6bd4\u65b9\u8bf4<code>column-rule-width:1px<\/code>\u4e4b\u7c7b\uff0c\u4e8e\u662f\u5bf9\u5173\u952e\u5b57\u5c5e\u6027\u503c\u4e0d\u592a\u4e86\u89e3\uff0c\u8fd9\u91cc\u4ecb\u7ecd\u4e0b\u3002<code>column-rule-width<\/code>\u652f\u6301\u4e09\u4e2a\u5173\u952e\u5b57\u5c5e\u6027\u503c\uff0c\u5206\u522b\u662f<code>thin<\/code>\uff0c<code>medium<\/code>\uff08\u9ed8\u8ba4\u503c\uff09\u548c<code>thick<\/code>\uff0c\u5bf9\u5e94\u7684\u5177\u4f53\u5c3a\u5bf8\u5927\u5c0f\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li><strong><code>thin<\/code><\/strong>\uff1a\u8584\u8584\u7684\uff0c\u7b49\u540c\u4e8e<code>1px<\/code>\uff1b<\/li>\n<li><strong><code>medium<\/code><\/strong>\uff08\u9ed8\u8ba4\u503c\uff09\uff1a\u8584\u539a\u5747\u5300\uff0c\u7b49\u540c\u4e8e<code>3px<\/code>\uff1b<\/li>\n<li><strong><code>thick<\/code><\/strong>\uff1a\u539a\u539a\u7684\uff0c\u7b49\u540c\u4e8e<code>5px<\/code>\uff1b<\/li>\n<\/ol>\n<p>\u4e0d\u77e5\u5927\u5bb6\u6709\u6ca1\u6709\u60f3\u8fc7\u8fd9\u4e48\u4e00\u4e2a\u95ee\u9898\uff1a\u4e3a\u4ec0\u4e48\u9ed8\u8ba4\u5bbd\u5ea6\u5927\u5c0f\u662f<code>medium<\/code>\uff0c\u4e5f\u5c31\u662f3px\uff0c\u660e\u660ethin\uff081px\uff09\u5bbd\u5ea6\u66f4\u5e38\u7528\u5427\uff1f\u8fd9\u662f\u56e0\u4e3a\u2026\u2026<code>column-rule-style:double<\/code>\u81f3\u5c113px\u624d\u6709\u6548\u679c\uff01<\/p>\n<h4 id=\"column-rule\">6. column-rule<\/h4>\n<p><code>column-rule<\/code>\u662f<code><a href=\"#column-rule-width\">column-rule-width<\/a><\/code>\uff0c<code><a href=\"#column-rule-style\">column-rule-style<\/a><\/code>\u548c<code><a href=\"#column-rule-color\">column-rule-color<\/a><\/code>\u8fd93\u4e2aCSS\u5c5e\u6027\u7684\u7f29\u5199\u3002\u6b63\u5982<code>border<\/code>\u662f<code>border-style<\/code>\uff0c<code>border-width<\/code>\u548c<code>border-color<\/code>\u7684\u7f29\u5199\u4e00\u6837\u3002<\/p>\n<p>\u5176\u4ed6\u6ca1\u4ec0\u4e48\u597d\u8bf4\u7684\uff0c\u51e0\u4e2a\u5c5e\u6027\u503c\u987a\u5e8f\u4e0d\u8bb2\u7a76\uff0c\u968f\u4fbf\u3002\u9664\u4e86<code><a href=\"#column-rule-style\">column-rule-style<\/a><\/code>\u4e4b\u5916\u90a3\u5176\u5b83\u4e24\u4e2a\u5c5e\u6027\u53ef\u4ee5\u7f3a\u7701\u3002<\/p>\n<h4 id=\"column-span\">7. column-span<\/h4>\n<p><code>column-span<\/code>\u6709\u70b9\u7c7b\u4f3c\u4e8e\u8868\u683c\u5e03\u5c40\u4e2d\u7684<code>colspan<\/code>\u8fd9\u4e2aHTML\u5c5e\u6027\uff0c\u8868\u793a\u67d0\u4e00\u4e2a\u5185\u5bb9\u662f\u5426\u8de8\u591a\u680f\u663e\u793a\u3002<\/p>\n<p><strong>\u8bed\u6cd5<\/strong><\/p>\n<pre>column-span: none;\r\ncolumn-span: all;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>none<\/strong><\/dt>\n<dd>\u8868\u793a\u4e0d\u6a2a\u8de8\u591a\u680f\uff0c\u9ed8\u8ba4\u503c\u3002<\/dd>\n<dt><strong>all<\/strong><\/dt>\n<dd>\u8868\u793a\u6a2a\u8de8\u6240\u6709\u5782\u76f4\u5217\u3002<\/dd>\n<\/dl>\n<p>\u6211\u4eec\u4e00\u8d77\u6765\u770b\u4e00\u4e2a\u4f8b\u5b50\uff0c\u5c31\u77e5\u9053\u8fd9\u4e2a\u5c5e\u6027\u662f\u5e72\u561b\u7528\u7684\u4e86\uff1a<\/p>\n<div class=\"cmn-box\"><input type=\"radio\" id=\"colSpan1\" class=\"cmn-radio-1 cmn-span-1\" name=\"colTest4\" checked><input type=\"radio\" id=\"colSpan2\" class=\"cmn-radio-2 cmn-span-2\" name=\"colTest4\"><\/p>\n<div class=\"cmn-tab\"><label for=\"colSpan1\" class=\"cmn-tab-li\">column-span:none<\/label><label for=\"colSpan2\" class=\"cmn-tab-li\">column-span:all<\/label><\/div>\n<div class=\"cmn-content\">\n<p style=\"margin-top: 0;\">\u5728HTML\u4e2d\uff0c\u7c7b\u4f3c\u5355\u5143\u683c<code>&lt;td&gt;<\/code>\u5143\u7d20\u53ef\u4ee5\u8bbe\u7f6e<code>colspan<\/code>\u5c5e\u6027\uff0c\u8868\u793a\u5408\u5e76\u5355\u5143\u683c\uff0c\u4f8b\u5982<code>colspan=\"3\"<\/code>\u8868\u793a3\u4e2a\u666e\u901a\u5355\u5143\u683c\u5408\u5e76\u62101\u4e2a\u5927\u7684\u5355\u5143\u683c\u3002<\/p>\n<p class=\"cmn-span\"><code>column-span<\/code>\u8fd9\u4e2aCSS\u5c5e\u6027\u4f5c\u7528\u4e0e\u4e4b\u7c7b\u4f3c\uff0c\u53ea\u662f\u4e0d\u80fd\u6307\u5b9a\u5177\u4f53\u7684\u6570\u76ee\u3002\u8981\u4e48\u4e0d\u8de8\u5217\uff0c\u8981\u8de8\u5c31\u8de8\u5168\u90e8\u6761\u5217\u3002<\/p>\n<p style=\"margin-bottom: 0;\">\u5728\u6211\u4eec\u60f3\u8981\u5728\u5782\u76f4\u5206\u680f\u663e\u793a\u7684\u6587\u7ae0\u4e2d\u63d2\u4e00\u4e2a\u6a2a\u8d2f\u6574\u4e2a\u9875\u9762\u7684\u5e7f\u544a\u7684\u65f6\u5019\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u5c5e\u6027\u3002\u6216\u8005\u5355\u7eaf\u53ea\u662f\u5e0c\u671b\u4e0a\u4e0b\u518d\u5782\u76f4\u5206\u680f\u663e\u793a\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u8be5\u5c5e\u6027\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<p>\u5b9e\u9645\u5f00\u53d1\u7684\u65f6\u5019\uff0c\u975e\u6307\u5b9a\u67d0\u4e2a\u5143\u7d20<code>column-span:all<\/code>\uff0c\u6ca1\u6709\u6587\u672c\u5185\u5bb9\uff0c\u5c31\u4e00\u4e2a\u9ad8\u5ea6\uff0c\u6216\u8005\u52a0\u4e2a\u6c34\u5e73\u8fb9\u6846\uff0c\u5c31\u53ef\u4ee5\u5c06\u6587\u7ae0\u5185\u5bb9\u8fdb\u4e00\u6b65\u4e0a\u4e0b\u5206\u680f\u3002\u4e8e\u662f\uff0c\u4e00\u7bc7\u6587\u7ae0\u7684\u5185\u5bb9\uff0c\u5c31\u5982\u62a5\u7eb8\u6392\u7248\u4e00\u6837\uff0c\u60f3\u8981\u5728\u54ea\u91cc\u5206\u680f\u5c31\u968f\u5fc3\u6240\u6b32\u4e86\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u63d2\u5165\u901a\u680f\u5e7f\u544a\u4e5f\u53ef\u4ee5\u4f7f\u7528\u8be5\u5c5e\u6027\u3002<\/p>\n<h4 id=\"column-fill\">8. column-fill<\/h4>\n<p><code>column-fill<\/code>\u4f5c\u7528\u662f\u5f53\u5185\u5bb9\u5206\u680f\u7684\u65f6\u5019\uff0c\u5982\u4f55\u5e73\u8861\u6bcf\u4e00\u680f\u586b\u5145\u7684\u5185\u5bb9\u3002<\/p>\n<p><strong>\u8bed\u6cd5<\/strong><\/p>\n<pre>column-fill: auto;\r\ncolumn-fill: balance;\r\ncolumn-fill: balance-all;\r\n<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>auto<\/strong><\/dt>\n<dd>\u6309\u987a\u5e8f\u586b\u5145\u6bcf\u4e00\u5217\u3002\u5185\u5bb9\u53ea\u5360\u7528\u5b83\u9700\u8981\u7684\u7a7a\u95f4\u3002<\/dd>\n<dt><strong>balance<\/strong><\/dt>\n<dd>\u9ed8\u8ba4\u503c\u3002\u5c3d\u53ef\u80fd\u5728\u5217\u4e4b\u95f4\u5e73\u8861\u5185\u5bb9\u3002\u5728\u5206\u9694\u65ad\u5f00\u7684\u4e0a\u4e0b\u6587\u4e2d\uff0c\u53ea\u6709\u6700\u540e\u4e00\u4e2a\u7247\u6bb5\u662f\u5e73\u8861\u7684\u3002\u4e3e\u4f8b\u6765\u8bf4\u5c31\u662f\u6709\u591a\u4e2a<code>&lt;p&gt;<\/code>\u5143\u7d20\uff0c\u6b63\u597d\u6700\u540e\u4e00\u4e2a<code>&lt;p&gt;<\/code>\u6362\u884c\u4e86\uff0c\u90a3\u8fd9\u4e2a<code>&lt;p&gt;<\/code>\u5143\u7d20\u7684\u5185\u5bb9\u524d\u540e\u7b49\u5206\uff0c\u4fdd\u6301\u5e73\u8861\u3002\u8fd9\u5c31\u4f1a\u9020\u6210\u6700\u540e\u4e00\u680f\u5185\u5bb9\u8f83\u5c11\u7684\u60c5\u51b5\u3002<\/dd>\n<dt><strong>balance-all<\/strong>\uff08\u53ef\u5ffd\u7565\uff09<\/dt>\n<dd>\u5c3d\u53ef\u80fd\u5728\u5217\u4e4b\u95f4\u5e73\u8861\u5185\u5bb9\u3002\u5728\u5206\u9694\u65ad\u5f00\u7684\u4e0a\u4e0b\u6587\u4e2d\uff0c\u6240\u6709\u7247\u6bb5\u90fd\u662f\u5e73\u8861\u7684\u3002<\/dd>\n<\/dl>\n<p>\u6211\u4eec\u4e00\u8d77\u6765\u770b\u4e00\u4e2a\u4e0e<code>column-fill<\/code>\u5c5e\u6027\u76f8\u5173\u7684demo\uff08\u76ee\u524d\u4ec5Firefox\u6d4f\u89c8\u5668\u6709\u6b63\u786e\u8868\u73b0\uff09\uff1a<\/p>\n<div class=\"cmn-box\"><input type=\"radio\" id=\"colFill1\" class=\"cmn-radio-1 cmn-fill-1\" name=\"colTest5\"><input type=\"radio\" id=\"colFill2\" class=\"cmn-radio-2 cmn-span-2\" name=\"colTest5\" checked><input type=\"radio\" id=\"colFill3\" class=\"cmn-radio-3 cmn-span-3\" name=\"colTest5\"><\/p>\n<div class=\"cmn-tab\"><label for=\"colFill1\" class=\"cmn-tab-li\">column-fill:auto<\/label><label for=\"colFill2\" class=\"cmn-tab-li\">column-fill:balance<\/label><label for=\"colFill3\" class=\"cmn-tab-li\">column-fill:balance-all<\/label><\/div>\n<div class=\"cmn-content\">\n<p style=\"margin-top: 0;\">\u8fd9\u662f\u4e00\u5806\u5206\u6210\u591a\u4e2a\u7684\u6587\u672c\u5217\u3002CSS`column-fill`\u5c5e\u6027\u662f\u7528\u4e8e\u5c06\u5185\u5bb9\u5747\u5300\u5730\u5206\u5e03\u5728\u4e00\u8d77\u6240\u6709\u5217\u3002<\/p>\n<p style=\"margin-bottom: 0;\"><code>column-fill<\/code>\u8fd9\u4e2a\u5c5e\u6027\u7684\u51c6\u786e\u6e32\u67d3\u9700\u8981\u5728Firefox\u6d4f\u89c8\u5668\u4e0b\u624d\u53ef\u4ee5\u770b\u5230\u3002\u5f53\u6211\u4eec\u70b9\u51fb<code>auto<\/code>\u7684\u65f6\u5019\uff0c\u6240\u6709\u7684\u6587\u5b57\u5185\u5bb9\u5e94\u8be5\u6324\u5728\u6700\u5de6\u8fb9\u4e00\u680f\u4e2d\u624d\u662f\u6b63\u786e\u7684\u3002\u4f46\u662fChrome\u548cIE\u4e0b\u5374\u548c<code>balance<\/code>\u5c5e\u6027\u503c\u8868\u73b0\u4e00\u6837\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<p>\u4e0a\u9762demo\u5f53\u6211\u4eec\u70b9\u51fb<code>'auto'<\/code>\u8fd9\u4e2a\u9009\u9879\u5361\u7684\u65f6\u5019\uff0c\u6b63\u786e\u7684\u8868\u73b0\u5e94\u8be5\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201901\/2019-01-30_233729.png\" width=\"416\" height=\"322\" alt=\"\u6b63\u786e\u7684\u6e32\u67d3\u8868\u73b0\"><\/p>\n<p>\u82e5\u8981\u8ba9\u6240\u6709\u6d4f\u89c8\u5668\u4e0b<code>column-fill:auto<\/code>\u90fd\u6709\u6548\u679c\uff0c\u9700\u8981\u7ed9\u5bb9\u5668\u5143\u7d20\u8bbe\u7f6e\u56fa\u5b9a\u7684\u9ad8\u5ea6\u503c\u83dc\u7cfb\u3002<\/p>\n<p>\u8fd8\u6709\uff0c\u6839\u636e\u6211\u5728IE\uff0cChrome\u548cFirefox\u6d4f\u89c8\u5668\u4e0b\u6d4b\u8bd5\uff0c\u8fd9\u51e0\u4e2a\u6d4f\u89c8\u5668\u70b9\u51fb<code>balance-all<\/code>\u90fd\u6ca1\u80fd\u8bc6\u522b\u3002\u6211\u67e5\u770b\u5b98\u65b9\u8349\u6848\u6587\u6863\uff0c\u4e5f\u6ca1\u6709<code>balance-all<\/code>\u7684\u793a\u610f\uff0c\u8be5\u5c5e\u6027\u503c\u5927\u5bb6\u53ef\u4ee5\u5ffd\u7565\u3002<\/p>\n<h4 id=\"column-gap\">9. column-gap<\/h4>\n<p><code>column-gap<\/code>\u8868\u793a\u6bcf\u4e00\u680f\u4e4b\u95f4\u7684\u90a3\u4e2a\u7a7a\u767d\u95f4\u9699\u5927\u5c0f\u3002<\/p>\n<p><strong>\u8bed\u6cd5<\/strong><\/p>\n<pre>column-gap: normal | &lt;length-percentage&gt;;<\/pre>\n<p><strong>\u5177\u4f53<\/strong><\/p>\n<pre><span style=\"color:green;\">\/* \u5173\u952e\u5b57\u503c *\/<\/span>\r\ncolumn-gap: normal; \r\n\r\n<span style=\"color:green;\">\/* \u957f\u5ea6\u503c *\/<\/span>\r\ncolumn-gap: 3px;\r\ncolumn-gap: 3em;\r\n\r\n<span style=\"color:green;\">\/* \u767e\u5206\u6bd4\u503c *\/<\/span>\r\ncolumn-gap: 3%;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>normal<\/strong><\/dt>\n<dd>\u9ed8\u8ba4\u503c\u3002\u5728\u591a\u680f\u5e03\u5c40\u4e2d\u4e3a<code>1em<\/code>\uff0c\u5728\u5176\u5b83\u7c7b\u578b\u7684\u5e03\u5c40\u4e2d\u4e3a<code>0<\/code>\u3002<\/dd>\n<dt><strong>&lt;length&gt;<\/strong><\/dt>\n<dd>\u5177\u4f53\u7684\u957f\u5ea6\u503c\u3002\u4e0d\u652f\u6301\u8d1f\u6570\u3002<\/dd>\n<dt><strong>&lt;percentage&gt;<\/strong><\/dt>\n<dd>\u767e\u5206\u6bd4\u503c\u3002\u548c<code>column-width<\/code>\u4e0d\u540c\uff0c<code>column-gap<\/code>\u652f\u6301\u767e\u5206\u6bd4\u503c\u3002\u540c\u6837\uff0c\u4e0d\u80fd\u662f\u8d1f\u6570\u3002<\/dd>\n<\/dl>\n<p><strong>\u5b9e\u5730demo\u6f14\u793a<\/strong><\/p>\n<div class=\"cmn-box cmn-box-gap\"><input type=\"radio\" id=\"colGap1\" class=\"cmn-radio-1 cmn-gap-1\" name=\"colTest6\" checked><input type=\"radio\" id=\"colGap2\" class=\"cmn-radio-2 cmn-gap-2\" name=\"colTest6\"><input type=\"radio\" id=\"colGap3\" class=\"cmn-radio-3 cmn-gap-3\" name=\"colTest6\"><input type=\"radio\" id=\"colGap4\" class=\"cmn-radio-4 cmn-gap-4\" name=\"colTest6\"><\/p>\n<div class=\"cmn-tab\"><label for=\"colGap1\" class=\"cmn-tab-li\">column-gap:normal<\/label><label for=\"colGap2\" class=\"cmn-tab-li\">column-gap:8%<\/label><label for=\"colGap3\" class=\"cmn-tab-li\">column-gap:80px<\/label><label for=\"colGap4\" class=\"cmn-tab-li\">column-gap:8em<\/label><\/div>\n<div class=\"cmn-content\">\n<p style=\"margin-top: 0;\">\u867d\u7136<code>column-gap<\/code>\u5c5e\u6027\u7684\u9ed8\u8ba4\u503c<code>normal<\/code>\u6700\u7ec8\u7684\u8868\u73b0\u5c31\u662f<code>1em<\/code>\uff0c\u4f46\u5e76\u4e0d\u8868\u793a\u53ef\u4ee5\u548c\u6570\u503c\u5c5e\u6027\u503c\u4ea7\u751f<code>transition<\/code>\u8fc7\u6e21\u6548\u679c\u3002\u56e0\u6b64\uff0c\u5f53\u6211\u4eec\u70b9\u51fb\u5230\u7b2c\u4e00\u4e2a\u9009\u9879\u5361\u7684\u65f6\u5019\uff0c\u5bbd\u5ea6\u53d8\u5316\u662f\u7a81\u7136\u7684\uff0c\u800c\u4e0d\u662f\u8fde\u7eed\u7684\u3002<\/p>\n<p style=\"margin-bottom: 0;\"><code>column-gap<\/code>\u548c<code>columns<\/code>\u5c5e\u6027\u53d1\u751f\u51b2\u7a81\u7684\u65f6\u5019\uff0c\u4f8b\u5982\uff0c<code>column-gap<\/code>\u592a\u5927\uff0c\u5bfc\u81f4\u7a7a\u95f4\u4e0d\u8db3\uff0c\u6b64\u65f6\uff0c<code>column-gap<\/code>\u662f\u4f1a\u88ab\u820d\u5f03\u7684\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<h3>\u4e09\u3001\u95f4\u63a5\u76f8\u5173CSS\u5c5e\u6027<\/h3>\n<p>\u6bcf\u4e2a\u53ef\u80fd\u7684\u65ad\u70b9\uff08\u6362\u53e5\u8bdd\u8bf4\uff0c\u6bcf\u4e2a\u5143\u7d20\u8fb9\u754c\uff09\u53d7\u4e09\u4e2a\u5c5e\u6027\u7684\u5f71\u54cd\uff1a\u524d\u4e00\u4e2a\u5143\u7d20\u7684<code>break-after<\/code>\u503c\uff0c\u4e0b\u4e00\u4e2a\u5143\u7d20\u7684<code><a href=\"#break-before\">break-before<\/a><\/code>\u503c\uff0c\u4ee5\u53ca\u5305\u542b\u5143\u7d20\u7684<code><a href=\"#break-inside\">break-inside<\/a><\/code>\u503c\u3002<\/p>\n<p>\u4e0b\u9762\u8981\u4ecb\u7ecd\u76843\u4e2a\u5c5e\u6027\uff0c\u53ef\u4ee5\u63a7\u5236\u5206\u680f\u5e03\u5c40\u4e2d\u5f53\u524d\u5143\u7d20\u524d\u540e\u662f\u5426\u5141\u8bb8\u5206\u680f\u3002<\/p>\n<h4 id=\"break-after\">1. break-after<\/h4>\n<p><code>break-after<\/code>\u8fd9\u4e2aCSS\u5c5e\u6027\u5b9a\u4e49\u9875\u9762\uff0c\u5217\u6216\u533a\u57df\u4e2d\u65ad\u5728\u751f\u6210\u7684\u6846\u4e4b\u540e\u5e94\u8be5\u5982\u4f55\u8868\u73b0\u3002\u5982\u679c\u6ca1\u6709\u751f\u6210\u6846\uff0c\u5219\u5ffd\u7565\u8be5\u5c5e\u6027\u3002<\/p>\n<p><code>break-after<\/code>\u652f\u6301\u5c5e\u6027\u5f88\u591a\uff0c\u4f46\u5927\u591a\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\uff0c\u6211\u4eec\u76ee\u524d\u53ea\u8981\u5173\u6ce8\u4e0b\u9762\u4e24\u4e2a\u5c5e\u6027\u503c\u5c31\u597d\u4e86\uff1a<\/p>\n<pre>break-after: auto;\r\nbreak-after: avoid;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>auto<\/strong><\/dt>\n<dd>\u5141\u8bb8\u4f46\u4e0d\u5f3a\u5236\u5728\u4e3b\u6846\u4e4b\u540e\u63d2\u5165\u4efb\u4f55\u4e2d\u65ad\uff08page\uff0ccolumn\u6216region\u5e03\u5c40\u4e0b\uff09\u3002<\/dd>\n<dt><strong>avoid<\/strong><\/dt>\n<dd>\u907f\u514d\u5728\u4e3b\u4f53\u6846\u540e\u63d2\u5165\u4efb\u4f55\u5206\u9694\u7b26\uff08page\uff0ccolumn\u6216region\u5e03\u5c40\u4e0b\uff09\u3002<\/dd>\n<\/dl>\n<h4 id=\"break-before\">2. break-before<\/h4>\n<p><code>break-before<\/code>\u8fd9\u4e2aCSS\u5c5e\u6027\u5b9a\u4e49\u9875\u9762\uff0c\u5217\u6216\u533a\u57df\u4e2d\u65ad\u5728\u751f\u6210\u7684\u6846\u4e4b\u524d\u5e94\u8be5\u5982\u4f55\u8868\u73b0\u3002\u5982\u679c\u6ca1\u6709\u751f\u6210\u6846\uff0c\u5219\u5ffd\u7565\u8be5\u5c5e\u6027\u3002<\/p>\n<p><code>break-before<\/code>\u652f\u6301\u5c5e\u6027\u5f88\u591a\uff0c\u4f46\u5927\u591a\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\uff0c\u6211\u4eec\u76ee\u524d\u53ea\u8981\u5173\u6ce8\u4e0b\u9762\u4e24\u4e2a\u5c5e\u6027\u503c\u5c31\u597d\u4e86\uff1a<\/p>\n<pre>break-before: auto;\r\nbreak-before: avoid;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>auto<\/strong><\/dt>\n<dd>\u5141\u8bb8\u4f46\u4e0d\u5f3a\u5236\u5728\u4e3b\u6846\u4e4b\u524d\u63d2\u5165\u4efb\u4f55\u4e2d\u65ad\uff08page\uff0ccolumn\u6216region\u5e03\u5c40\u4e0b\uff09\u3002<\/dd>\n<dt><strong>avoid<\/strong><\/dt>\n<dd>\u907f\u514d\u5728\u4e3b\u4f53\u6846\u524d\u63d2\u5165\u4efb\u4f55\u5206\u9694\u7b26\uff08page\uff0ccolumn\u6216region\u5e03\u5c40\u4e0b\uff09\u3002<\/dd>\n<\/dl>\n<h4 id=\"break-inside\">3. break-inside<\/h4>\n<p><code>break-inside<\/code>\u8fd9\u4e2aCSS\u5c5e\u6027\u5b9a\u4e49\u9875\u9762\u3001\u5217\u6216\u533a\u57df\u53d1\u751f\u4e2d\u65ad\u65f6\u5019\u7684\u5143\u7d20\u8be5\u5982\u4f55\u8868\u73b0\u3002\u5982\u679c\u6ca1\u6709\u4e2d\u65ad\uff0c\u5219\u5ffd\u7565\u8be5\u5c5e\u6027\u3002<\/p>\n<p><code>break-inside<\/code>\u652f\u6301\u5c5e\u6027\u76f8\u5bf9\u5c11\u4e00\u4e9b\uff0c\u540c\u6837\u7684\uff0c\u6211\u4eec\u76ee\u524d\u53ea\u8981\u5173\u6ce8\u4e0b\u9762\u4e24\u4e2a\u5c5e\u6027\u503c\u5c31\u597d\u4e86\uff1a<\/p>\n<pre>break-inside: auto;\r\nbreak-inside: avoid;<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<dl>\n<dt><strong>auto<\/strong><\/dt>\n<dd>\u5143\u7d20\u53ef\u4ee5\u4e2d\u65ad\u3002<\/dd>\n<dt><strong>avoid<\/strong><\/dt>\n<dd>\u5143\u7d20\u4e0d\u80fd\u4e2d\u65ad\u3002<\/dd>\n<\/dl>\n<p><strong>demo\u5b9e\u4f8b\u9875\u9762<\/strong><\/p>\n<p>\u62ffcolumn\u5206\u680f\u5e03\u5c40\u4e3e\u4f8b\uff0c\u5206\u680f\u5e03\u5c40\u5728\u6d41\u52a8\u548c\u5e73\u8861\u5185\u5bb9\u65b9\u9762\u505a\u5f97\u5f88\u597d\u3002\u4e0d\u5e78\u7684\u662f\uff0c\u5e76\u975e\u6240\u6709\u5143\u7d20\u90fd\u80fd\u4f18\u96c5\u5730\u6d41\u52a8\u3002\u6709\u65f6\u5143\u7d20\u4f1a\u65ad\u5f00\u5206\u5e03\u5728\u4e24\u4e2a\u5217\u4e2d\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201901\/2019-01-31_005757.png\" width=\"425\" height=\"463\" alt=\"\u6587\u5b57\u65ad\u884c\u663e\u793a\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u5e0c\u671b\u6211\u4eec\u7684\u6761\u76ee\u4e00\u4e2a\u5143\u7d20\u4e00\u4e2a\u5143\u7d20\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u524d\u540e\u90fd\u4e0d\u65ad\u5f00\uff0c\u6b64\u65f6\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528<code>break-inside:avoid<\/code>\u5b9e\u73b0\uff1a<\/p>\n<pre>.list {\r\n  -webkit-column-break-inside: avoid; <span style=\"color:green;\">\/* Chrome, Safari, Opera *\/<\/span>\r\n            page-break-inside: avoid; <span style=\"color:green;\">\/* Firefox *\/<\/span>\r\n                 break-inside: avoid; <span style=\"color:green;\">\/* IE 10+, Chrome, Safari, Opera *\/<\/span>\r\n}<\/pre>\n<p>\u6b64\u65f6\u6548\u679c\u5982\u4e0b\u622a\u56fe\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201901\/2019-01-31_010224.png\" width=\"479\" height=\"254\" alt=\"\u524d\u540e\u4e0d\u65ad\u5f00\u7684\u6548\u679c\u622a\u56fe\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/study\/201901\/css-break-inside-demo.php\" rel=\"noopener\" target=\"_blank\">CSS break-inside\u4e0e\u5206\u680f\u4e0d\u65ad\u5f00demo<\/a><\/p>\n<p><strong>\u5176\u4ed6<\/strong><\/p>\n<p>\u5e94\u8be5\u662f\u4e0a\u4e2a\u6708\uff0c\u8fd8\u4ecb\u7ecd\u4e86\u4e00\u4e2a\u540d\u4e3a<code>box-decoration-break<\/code>\u7684CSS\u5c5e\u6027\uff0c\u4e5f\u4e0ecolumns\u5e03\u5c40\u662f\u76f8\u5173\u7684\uff0c\u5176\u4f5c\u7528\u66f4\u591a\u7684\u662f\u5143\u7d20\u65ad\u5f00\u540e\u7684\u88c5\u9970\u8868\u73b0\u3002\u6709\u5174\u8da3\u53ef\u4ee5\u53c2\u89c1\u8fd9\u7bc7\u6587\u7ae0\uff1a\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2019\/01\/css-css3-box-decoration-break\/\">CSS\/CSS3 box-decoration-break\u5c5e\u6027\u7b80\u4ecb<\/a>\u201d\u3002<\/p>\n<h3>\u56db\u3001\u4e00\u4e9b\u7279\u6b8a\u5e03\u5c40\u5e94\u7528\u4e3e\u4f8b<\/h3>\n<p>CSS3 columns\u591a\u680f\u5e03\u5c40\u53ef\u4ee5\u5b9e\u73b0\u6c34\u5e73\u7ffb\u4e66\u9605\u8bfb\u6548\u679c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201901\/read-h-columns-s.gif\" width=\"364\" height=\"632\" alt=\"\u6c34\u5e73\u7ffb\u4e66\u9605\u8bfb\u6548\u679c\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u5177\u4f53\u89c1\u8fd9\u7bc7\u6587\u7ae0\uff1a\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=5945\">\u57fa\u4e8eCSS3 column\u591a\u680f\u5e03\u5c40\u5b9e\u73b0\u6c34\u5e73\u7ffb\u9875\u4ea4\u4e92<\/a>\u201d\u3002<\/p>\n<p>CSS3 columns\u591a\u680f\u5e03\u5c40\u8fd8\u53ef\u4ee5\u7528\u6765\u5b9e\u73b0\u7b49\u5206\u5bfc\u822a\u6548\u679c\uff0c\u652f\u6301\u5355\u884c\u548c\u591a\u884c\uff0c\u7c7b\u4f3cflex\u5e03\u5c40\u90a3\u79cd\u6548\u679c\uff0c\u4f46\u517c\u5bb9\u6027\u6bd4flex\u8981\u597d\u3002\u672c\u6587\u7bc7\u5e45\u5df2\u7ecf\u5f88\u957f\u4e86\uff0c\u76f8\u5173\u5185\u5bb9\u6211\u56de\u5934\u4e13\u95e8\u5199\u4e00\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u3002<\/p>\n<p><strong>\u5176\u4ed6\u7c7b\u4f3c\u4e3b\u9898\u6587\u7ae0<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2018\/10\/display-flex-css3-css\/\">\u5199\u7ed9\u81ea\u5df1\u770b\u7684display: flex\u5e03\u5c40\u6559\u7a0b<\/a><\/li>\n<li><a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2018\/11\/display-grid-css-css3\/\">\u5199\u7ed9\u81ea\u5df1\u770b\u7684display: grid\u5e03\u5c40\u6559\u7a0b<\/a><\/li>\n<\/ul>\n<p>\u80fd\u591f\u9605\u8bfb\u5230\u8fd9\u91cc\u7684\u90fd\u662f\u771f\u7231\uff0c\u611f\u8c22\uff0c\u6bd4\u5fc3\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/emtion\/emoji\/2764.svg\" width=\"20\" height=\"20\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8436\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=8436<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201810\/flex-thumb.jpg\" width=\"161\" height=\"100\" class=\"alignright size-medium\" alt=\"columns\u5e03\u5c40\"><\/p>\n<p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86CSS columns\u5206\u680f\u5e03\u5c40\u7684\u5404\u4e2aCSS\u5c5e\u6027\u7684\u8bed\u6cd5\u4ee5\u53ca\u4e00\u4e9b\u7ec6\u8282\uff0c\u6240\u6709\u6548\u679c\u90fd\u53ef\u4ee5\u5b9e\u65f6\u4f53\u9a8c\uff0c\u540c\u65f6\u8fd8\u4ecb\u7ecd\u4e86\u4e00\u4e9b\u95f4\u63a5\u76f8\u5173\u7684CSS\u5c5e\u6027\uff0c\u4f8b\u5982break-inside\u7b49\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1405,1404,1102,177,1271,231],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/8436"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=8436"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/8436\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=8436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=8436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=8436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}