css盒子模型
css盒子模型是css的基础知识,很多时候面试的时候会问到,就了解一下
css盒子模型组成包括:content,padding,border,margin;
css盒子模型分为两种:标准盒子模型和IE盒子模型;
标准盒子模型:content+padding+border+margin;
IE盒子模型:content(包含padding+border) + margin;
两者的区别就在于IE盒子模型的content包括padding和border,而标准盒子模型不包括;
平时css的属性box-sizing 默认值是content-box;也就是content不包括padding和border,而box-sizing:border-box;是指content包括padding和border的