阐述:盒子模型有两种,分别为:标准模型,非标准模型
- 盒子模型包含如下操作
/*边框线设置 宽度:1px 类型:实心 颜色:红色*/
border:1px solid red;
/*边框圆角设置 角弯曲5px*/
border-radius:5px;
/*设置宽度 100像素*/
widht:100px;
/*设置盖度 100像素*/
height:100px;
/*设置外边距 10像素*/
margin:10px;
/*设置内边距 10像素*/
padding:10px;
- 标准模型
- 在使用padding时会使模型进行膨胀
- 非标准模型
- 在使用padding使模型不会受到影响
使用box-sizing可在(border-box)非标准与(content-box)标准模型之间进行转换。