<flex>
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2017.
<flex>
CSS 数据类型 表示了网格(grid)容器中的一段可变长度。于 grid-template-columns
、grid-template-rows
及相关属性中使用。
语法
<flex>
数据类型为一 <number>
后加单位 fr
。与所有 CSS 尺寸相同,单位与数字间无空格。
示例
css
1fr /* 使用整型 */
2.5fr /* 使用浮点 */
规范
Specification |
---|
CSS Grid Layout Module Level 2 # fr-unit |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
<flex> |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.