files/en-us/web/css/reference/values/flex_value/index.md
The <flex> CSS data type denotes a flexible length within a grid container. It is used in {{cssxref("grid-template-columns")}}, {{cssxref("grid-template-rows")}} and other related properties.
The <flex> data type is specified as a {{cssxref("<number>")}} followed by the unit fr. The fr unit represents a fraction of the leftover space in the grid container. As with all CSS dimensions, there is no space between the unit and the number.
1fr /* Using an integer value */
2.5fr /* Using a float value */
.grid {
display: grid;
grid-template-columns: 1fr 1fr 2.5fr 1.5fr;
}
{{Specifications}}
{{Compat}}