box-sizing的用法(笔记)

关于盒子布局的box-sizing的使用

border-box width 和 height 属性包括内容,内边距和边框,但不包括外边距。这是当文档处于 Quirks模式 时Internet Explorer使用的盒模型。注意,填充和边框将在盒子内 , 例如, .box { 350px; border: 10px solid black;} 导致在浏览器中呈现的宽度为350px的盒子。内容框不能为负,并且被分配到0,使得不可能使用border-box使元素消失。

尺寸计算公式:width = border + padding + 内容的宽度height = border + padding + 内容的高度

原文地址:https://www.cnblogs.com/Guhongying/p/10775019.html