<flex> CSS 数据类型 表示了网格(grid)容器中的一段可变长度。于grid-template-columnsgrid-template-rows及相关属性中使用。

语法

<flex>数据类型为一<number>后加单位fr。与所有CSS尺寸相同,单位与数字间无空格。

Examples

1fr    /* 使用整型 */
2.5fr  /* 使用浮点 */

规范

规范 状态 注释
CSS Grid Layout
<flex>
Candidate Recommendation 初步定义

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 29Edge Full support 16Firefox Full support 40IE No support NoOpera Full support 28Safari Full support 10.1WebView Android Full support 57Chrome Android Full support 29Edge Mobile Full support 16Firefox Android Full support 40Opera Android Full support 44Safari iOS Full support 10.3Samsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support

See also

文档标签和贡献者

此页面的贡献者: fscholz, huasheng
最后编辑者: fscholz,