box-sizing
介绍
box-sizing 决定元素的width
和height
如何解析。
取值
提示
尺寸计算公式:
width = border + padding + content
height = border + padding + content
提示
尺寸计算公式:
width = content
height = content
- 默认值 border-box
样例:
box-sizing: border-box;
box-sizing: content-box;
1
2
2
标准化语法
content-box | border-box
1
与 Web 的区别
暂时不支持 inherit、initial、revert、unset 等取值。
默认值为border-box
。