-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
85 lines (58 loc) · 1.93 KB
/
index.md
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
---
title: column-count
slug: Web/CSS/column-count
page-type: css-property
browser-compat: css.properties.column-count
---
{{CSSRef}}
The **`column-count`** [CSS](/en-US/docs/Web/CSS) property breaks an element's content into the specified number of columns.
{{EmbedInteractiveExample("pages/css/column-count.html")}}
## Syntax
```css
/* Keyword value */
column-count: auto;
/* <integer> value */
column-count: 3;
/* Global values */
column-count: inherit;
column-count: initial;
column-count: revert;
column-count: revert-layer;
column-count: unset;
```
### Values
- `auto`
- : The number of columns is determined by other CSS properties, such as {{cssxref("column-width")}}.
- {{cssxref("<integer>")}}
- : Is a strictly positive {{cssxref("<integer>")}} describing the ideal number of columns into which the content of the element will be flowed. If the {{cssxref("column-width")}} is also set to a non-`auto` value, it merely indicates the maximum allowed number of columns.
## Formal definition
{{cssinfo}}
## Formal syntax
{{csssyntax}}
## Examples
### Splitting a paragraph across three columns
#### HTML
```html
<p class="content-box">
This is a bunch of text split into three columns using the CSS
<code>column-count</code>
property. The text is equally distributed over the columns.
</p>
```
#### CSS
```css
.content-box {
column-count: 3;
}
```
#### Result
{{EmbedLiveSample('Splitting_a_paragraph_across_three_columns', 'auto', 120)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{CSSXref("column-width")}}, {{CSSXref("columns")}} shorthand
- {{CSSXref("column-rule-color")}}, {{CSSXref("column-rule-style")}}, {{CSSXref("column-rule-width")}}, {{CSSXref("column-rule")}} shorthand
- [Multiple-column Layout](/en-US/docs/Learn/CSS/CSS_layout/Multiple-column_Layout) (Learn Layout)
- [Basic Concepts of Multicol](/en-US/docs/Web/CSS/CSS_multicol_layout/Basic_concepts)