-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
110 lines (80 loc) · 2.45 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
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
---
title: column-span
slug: Web/CSS/column-span
page-type: css-property
browser-compat: css.properties.column-span
---
{{CSSRef}}
The **`column-span`** [CSS](/en-US/docs/Web/CSS) property makes it possible for an element to span across all columns when its value is set to `all`.
{{EmbedInteractiveExample("pages/css/column-span.html")}}
An element that spans more than one column is called a **spanning element**.
## Syntax
```css
/* Keyword values */
column-span: none;
column-span: all;
/* Global values */
column-span: inherit;
column-span: initial;
column-span: revert;
column-span: revert-layer;
column-span: unset;
```
The `column-span` property is specified as one of the keyword values listed below.
### Values
- `none`
- : The element does not span multiple columns.
- `all`
- : The element spans across all columns. Content in the normal flow that appears before the element is automatically balanced across all columns before the element appears. The element establishes a new block formatting context.
## Formal definition
{{cssinfo}}
## Formal syntax
{{csssyntax}}
## Examples
### Making a heading span columns
In this example, the heading is made to span across all the columns of the article.
#### HTML
```html
<article>
<h2>Header spanning all of the columns</h2>
<p>
The h2 should span all the columns. The rest of the text should be
distributed among the columns.
</p>
<p>
This is a bunch of text split into three columns using the CSS `columns`
property. The text is equally distributed over the columns.
</p>
<p>
This is a bunch of text split into three columns using the CSS `columns`
property. The text is equally distributed over the columns.
</p>
<p>
This is a bunch of text split into three columns using the CSS `columns`
property. The text is equally distributed over the columns.
</p>
<p>
This is a bunch of text split into three columns using the CSS `columns`
property. The text is equally distributed over the columns.
</p>
</article>
```
#### CSS
```css
article {
columns: 3;
}
h2 {
column-span: all;
}
```
#### Result
{{EmbedLiveSample('Making_a_heading_span_columns', 'auto', 260)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [Spanning and balancing columns](/en-US/docs/Web/CSS/CSS_multicol_layout/Spanning_balancing_columns)
- [Inline-level elements](/en-US/docs/Glossary/Inline-level_content)
- {{domxref("HTMLSpanElement")}}