grid-column
Introduction
The grid-column CSS shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area.
This property is a shorthand for the CSS properties: grid-column-start and grid-column-end, thereby specifying the grid item's start and end column positions in a single declaration.
Syntax
Values
-
autoDefault value. A keyword indicating that the property contributes nothing to the grid item's placement, indicating auto-placement, an automatic span, or a default span of
1. -
<number>Contributes the nth grid line to the grid item's placement. If a negative integer is given, it counts in reverse, starting from the end edge of the explicit grid. An integer value of 0 is invalid.
-
span <number>Contributes a grid span to the grid item's placement, such that the column start or end edge of the grid item's grid area is n lines from the opposite edge.
Formal definition
| Initial value | as each of the properties of the shorthand:
|
| Applies to | grid items |
| Inherited | no |
| Animatable |
Formal syntax
Differences from the Web
<custom-ident>,span && <custom-ident>,<integer> && <custom-ident>?are not supported.- In Lynx, the
<grid-line>syntax is equivalent to<number> | [span && <number>], and does not support the<custom-ident>values found in the Web standard.
Notes
-
When
grid-columnspecifies two distinct grid lines, the column span is determined by the distance between those lines, andgrid-column-spanis ignored. The following item spans three columns: -
Do not combine
grid-column-spanwithspan <number>ingrid-column. Both specify the column span and can override each other. The following declarations specify conflicting spans of three columns and one column:
Compatibility
LCD tables only load in the browser