设置元件的最大宽度。它可以阻止 width
属性的应用值大于 max-width
的值。
max-width
的值会覆盖 width
和 min-width
。
<length>
<length>
定义了一个确定值。
<percentage>
以包含区块的宽度百分比定义 max-width
。
初始值 | 盒子宽度没有限制 |
适用元素 | 所有元件 |
是否支持继承 | 否 |
是否支持动画 | yes |
百分比 | refer to the width of the containing block |
none
,max-content
,min-content
,fit-content
。max-width
会覆盖 min-width
。LCD tables only load in the browser