The element behaves like a block-level element and lays out its content according to the flexbox model.
grid
The element behaves like a block-level element and lays out its content according to the grid model.
flex-direction: column;
row
The flex container's main-axis is defined to be the same as the text direction. The main-start and main-end points are the same as the content direction.
row-reverse
Behaves the same as row but the main-start and main-end points are opposite to the content direction.
column
The flex container's main-axis is the same as the block-axis. The main-start and main-end points are the same as the before and after points of the writing-mode.
column-reverse
Behaves the same as column but the main-start and main-end are opposite to the content direction.
column-gap: 10px;
normal
The browser's default spacing is used between columns. For multi-column layout this is specified as 1em. For all other layout types it is 0.
length
The size of the gap between columns, defined as a length(like px, em, rem, vh). The length property's value must be non-negative.
percentage
The size of the gap between columns, defined as a percentage. The percentage property's value must be non-negative.
row-gap: 10px;
normal
The browser's default spacing is used between columns. For multi-column layout this is specified as 1em. For all other layout types it is 0.
length
The size of the gap between columns, defined as a length(like px, em, rem, vh). The length property's value must be non-negative.
percentage
The size of the gap between columns, defined as a percentage. The percentage property's value must be non-negative.
padding: auto;
Values
The padding property may be specified using one, two, three, or four values. Each value is a or a . Negative values are invalid.
When one value is specified, it applies the same padding to all four sides.
When two values are specified, the first padding applies to the top and bottom, the second to the left and right.
When three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom.
When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise).
margin: auto;
Values
The margin property may be specified using one, two, three, or four values. Each value is a length, a percentage, or the keyword auto. Negative values draw the element closer to its neighbors than it would be by default.
When one value is specified, it applies the same margin to all four sides.
When two values are specified, the first margin applies to the top and bottom, the second to the left and right.
When three values are specified, the first margin applies to the top, the second to the right and left, the third to the bottom.
When four values are specified, the margins apply to the top, right, bottom, and left in that order (clockwise).
color: black;
The color property is specified as a single color value.
Note that the value must be a uniform color. It can't be a gradient, which is actually a type of image.
color
Sets the color of the textual and decorative parts of the element.
currentcolor
Sets the color to the element's color property value. However, if set as the value of color, currentcolor is treated as inherit.
background-color: white;
Text decorations are drawn across descendant text elements. This means that if an element specifies a text decoration, then a child element can't remove the decoration.
text-decoration-line
Sets the kind of decoration used, such as underline or line-through.
text-decoration-color
Sets the color of the decoration.
text-decoration-style
Sets the style of the line used for the decoration, such as solid, wavy, or dashed.
text-decoration-thickness
Sets the thickness of the line used for the decoration.
width: 100%;
The specified value of width applies to the content area so long as its value remains within the values defined by min-width and max-width.
If the value for width is less than the value for min-width, then min-width overrides width.
If the value for width is greater than the value for max-width, then max-width overrides width.
height: 80vh;
length
Defines the height as a distance value.
percentage
Defines the height as a percentage of the containing block's height.
auto
The browser will calculate and select a height for the specified element.
max-content
The intrinsic preferred height.
min-content
The intrinsic minimum height.
fit-content
Use the available space, but not more than max-content, i.e min(max-content, max(min-content, stretch)).
fit-content(length-percentage)
Uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, length-percentage)).
clamp()
Enables selecting a middle value within a range of values between a defined minimum and maximum.
border: 1px solid black;
line-width
Sets the thickness of the border. Defaults to medium if absent.
line-style
Sets the style of the border. Defaults to none if absent.
color
Sets the color of the border. Defaults to currentcolor if absent.
border-radius: 5px;
The border-radius property is specified as:
one, two, three, or four length or percentage values. This is used to set a single radius for the corners, followed optionally by "/" and one, two, three, or four length or percentage values. This is used to set an additional radius, so you can have elliptical corners.
opacity: 0 to 1 / 0% 100%;
A number in the range 0.0 to 1.0, inclusive, or a percentage in the range 0% to 100%, inclusive, representing the opacity of the channel (that is, the value of its alpha channel). Any value outside the interval, though valid, is clamped to the nearest limit in the range.
justify-content: center;
start
The items are packed flush to each other toward the start edge of the alignment container in the main axis.
end
The items are packed flush to each other toward the end edge of the alignment container in the main axis.
flex-start
The items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-start side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like start.
flex-end
The items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-end side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like end.
center
The items are packed flush to each other toward the center of the alignment container along the main axis.
left
The items are packed flush with each other toward the left edge of the alignment container. When the property's horizontal axis is not parallel with the inline axis, such as when flex-direction: column; is set, this value behaves like start.
right
The items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis (in a grid container) or the main-axis (in a flexbox container), this value behaves like start.
normal
Behaves as stretch, except in the case of multi-column containers with a non-auto column-width, in which case the columns take their specified column-width rather than stretching to fill the container. As stretch behaves as start in flex containers, normal also behaves as start.
space-between
The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items is the same. The first item is flush with the main-start edge, and the last item is flush with the main-end edge.
space-around
The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items is the same. The empty space before the first and after the last item equals half of the space between each pair of adjacent items.
space-evenly
The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items, the main-start edge and the first item, and the main-end edge and the last item, are all exactly the same.
stretch
If the combined size of the items along the main axis is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container along the main axis.
align-items: center;
normal
The effect of this keyword is dependent of the layout mode we are in:
In absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
In static position of absolutely-positioned layouts, the keyword behaves as stretch.
For flex items, the keyword behaves as stretch.
For grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
The property doesn't apply to block-level boxes, and to table cells.
flex-start
Used in flex layout only, aligns the flex items flush against the flex container's main-start or cross-start side.
flex-end
Used in flex layout only, aligns the flex items flush against the flex container's main-end or cross-end side.
center
The flex items' margin boxes are centered within the line on the cross-axis. If the cross-size of an item is larger than the flex container, it will overflow equally in both directions.
start
The items are packed flush to each other toward the start edge of the alignment container in the appropriate axis.
end
The items are packed flush to each other toward the end edge of the alignment container in the appropriate axis.
self-start
The items are packed flush to the edge of the alignment container's start side of the item, in the appropriate axis.
self-end
The items are packed flush to the edge of the alignment container's end side of the item, in the appropriate axis.
baseline, first baseline, last baseline
All flex items are aligned such that their flex container baselines align. The item with the largest distance between its cross-start margin edge and its baseline is flushed with the cross-start edge of the line.
stretch
If the items are smaller than the alignment container, auto-sized items will be equally enlarged to fill the container, respecting the items' width and height limits.
safe
Used alongside an alignment keyword. If the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start.
unsafe
Used alongside an alignment keyword. Regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored.