<fit-content>
fit-content() 目前支持在 width、height 和网格布局(grid)属性 (grid-template-columns、grid-template-rows、grid-auto-columns、grid-auto-rows) 中使用。
当用作 width 和 height 时,布局中取下列两者间的较大值:
- 0
- 内容最大大小和
fit-content()中指定值的较小值
fit-content 等价于 fit-content(auto),auto 指定值与父元件对应轴长度一致。
示例
兼容性
LCD tables only load in the browser