CSS的两种盒模型

150 阅读1分钟

W3C的标准盒模型(默认的盒模型)

在标准的盒子模型中,设置的width指content部分的宽度

box-sizing: content-box   /* box-sizing的默认属性是content-box */

IE盒模型

在IE盒子模型中,width表示content+padding+border这三个部分的宽度

box-sizing: border-box