CSS - columns
The columns
CSS property is a shorthand property allowing to set both the column-width
and the column-count
properties at the same time.
Example
CSS
Copy Code
.content-box { border: 10px solid #000000; columns:3; }
Syntax
CSS
Copy Code
columns: 1em; columns: 1; columns: auto; columns: 1 auto; columns: auto 12em; columns: auto auto;
Values
<'column-width'>
- Is a
<length>
value giving a hint of the optimal width of the column. The actual column width may be wider (to fill the available space), or narrower (only if the available space is smaller than the specified column width). The length must be strictly positive or the declaration is invalid. <'column-count'>
- Is a strictly positive
<integer>
describing the ideal number of columns into which the content of the element will be flowed. If thecolumn-width
is also set to a non-auto value, it merely indicates the maximum allowed number of columns.
Formal syntax
CSS
Copy Code
<a href="css/column-width" title="<length> | auto"><'column-width'></a> <a href="css/value_definition_syntax#double_bar" title="Double bar">||</a> <a href="css/column-count" title="<number> | auto"><'column-count'></a>
Description
The columns
CSS property is a shorthand property allowing to set both the column-width
and the column-count
properties at the same time.
Initial value | as each of the properties of the shorthand:
|
---|---|
Applies to | non-replaced block elements (except table elements), table-cell or inline-block elements |
Inherited | no |
Media | visual |
Computed value | as each of the properties of the shorthand:
|
Animation type | as each of the properties of the shorthand: |
Canonical order | order of appearance in the formal grammar of the values |
Browser Compatibility
See Also
Specifications
Specification | Status | Comment |
---|---|---|
CSS Multi-column Layout Module The definition of 'columns' in that specification. |
Candidate Recommendation | Initial definition |
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/columns