-
Notifications
You must be signed in to change notification settings - Fork 0
box sizing
draco1023 edited this page Aug 26, 2014
·
4 revisions
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
}
使用时去除星号前的符号,github显示星号有点问题
使用上述样式后,所有元素无需再计算margin、padding、border带来的宽度影响,支持IE8+
http://caniuse.com/#search=box-sizing
Known issue:
1. Android browsers do not calculate correctly the dimensions (width and height) of the HTML select element.
2. Safari 6.0.x does not use box-sizing on elements with display: table;
3. IE9 will subtract the width of the scrollbar to the width of the element when set to position: absolute, overflow: auto / overflow-y: scroll