aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/css_columns/index.html
blob: a2202c8b61fda92bbad2bdc3024fc1bae6b6b291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
title: CSS 多列布局
slug: Web/CSS/CSS_Columns
tags:
  - CSS
  - CSS参考
  - NeedsTranslation
  - Overview
  - TopicStub
  - 概述
translation_of: Web/CSS/CSS_Columns
---
<div>{{CSSRef("CSS3 Multicol")}}</div>

<p><strong>CSS多列布局(CSS Multi-column Layout)</strong>是一种定义了多栏布局的模块,可支持在布局中建立列(column)的数量,以及内容如何在列之间流动(flow)、列之间的间距(gap)大小,以及列的分隔线(column rules)。</p>

<h2 id="基本示例">基本示例</h2>

<p>在下列示例中,{{cssxref("column-count")}}属性应用于带有容器类的元素。因为<code>column-count</code>的值为<code>3</code>,所以内容排成等宽的3列。</p>

<p>{{EmbedGHLiveSample("css-examples/multicol/basics/column-count.html", '100%', 550)}}</p>

<h2 id="Relationship_to_Fragmentation">Relationship to Fragmentation</h2>

<p>Multiple-column Layout is closely related to <a href="/zh-CN/docs/Web/CSS/CSS_Pages">Paged Media</a>, in that each column box becomes a fragment, much like a printed page becomes a fragment of an overall document. Therefore the properties now defined in the <a href="/zh-CN/docs/Web/CSS/CSS_Fragmentation">CSS Fragmentation</a> specification are required in order to control how content breaks between columns. </p>

<h2 id="参考">参考</h2>

<h3 id="多列布局属性">多列布局属性</h3>

<div class="index">
<ul>
 <li>{{cssxref("column-count")}}</li>
 <li>{{cssxref("column-fill")}}</li>
 <li>{{cssxref("column-gap")}}</li>
 <li>{{cssxref("column-rule")}}</li>
 <li>{{cssxref("column-rule-color")}}</li>
 <li>{{cssxref("column-rule-style")}}</li>
 <li>{{cssxref("column-rule-width")}}</li>
 <li>{{cssxref("column-span")}}</li>
 <li>{{cssxref("column-width")}}</li>
 <li>{{cssxref("columns")}}</li>
</ul>
</div>

<h3 id="有关的CSS碎片化属性">有关的CSS碎片化属性</h3>

<div class="index">
<ul>
 <li>{{cssxref("break-after")}}</li>
 <li>{{cssxref("break-before")}}</li>
 <li>{{cssxref("break-inside")}}</li>
</ul>
</div>

<h2 id="指南">指南</h2>

<dl>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Columns/Basic_Concepts_of_Multicol">多列的基本概念</a></dt>
 <dd>多列布局的概述</dd>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Columns/Styling_Columns">设置列的样式</a></dt>
 <dd>如何使用列的分隔线,以及设置列间距。</dd>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Columns/Spanning_Columns">Spanning and Balancing</a></dt>
 <dd>How to make elements span across all columns and controlling the way columns are filled.</dd>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Columns/Handling_Overflow_in_Multicol">Handling Overflow in Multicol</a></dt>
 <dd>What happens when an item overflows the column it is in and what happens when there is too much columned content to fit a container.</dd>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Columns/Handling_content_breaks_in_multicol">Content Breaks in Multicol</a></dt>
 <dd>Introduction to the Fragmentation specification and how to control where column content breaks.</dd>
</dl>



<h2 id="规范">规范</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">指定</th>
   <th scope="col">状态</th>
   <th scope="col">注释</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Multicol')}}</td>
   <td>{{Spec2('CSS3 Multicol')}}</td>
   <td>初始定义</td>
  </tr>
 </tbody>
</table>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th></th>
   <th></th>
   <th></th>
   <th></th>
   <th></th>
   <th></th>
  </tr>
  <tr>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="sect1"></h2>

<h2 id="参见">参见</h2>

<p>其它CSS布局方法包括:</p>

<ul>
 <li><a href="https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Flexible_Box_Layout">CSS弹性盒子布局</a>(CSS flexbox)</li>
 <li><a href="https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Grid_Layout">CSS网格布局</a></li>
</ul>

<dl>
</dl>
</div>