转载请注明出处: http://qiudeqing.com/css3/2015/09/01/box-sizing.html

css默认宽高是内容的宽高,有border,padding的时候计算很麻烦.

box-sizing: border-box;设置元素宽度高度设置值为边框所在盒子,方便设置.

IE8支持box-sizingcan is use box-sizing

推荐的设置:

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}