We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
盒模型是css中的一种基础设计模式,web页面中的所有元素都可以当做一个盒模型,每一个盒模型都是由display, position,float, width, height, margin, padding 和border等属性组合所构成的,不同类型的盒模型会有不一样 的布局,css中 主要有inline, inline- -block, block, table, absolute position, float等类型。
css中的盒模型有两种: W3C标准模型和IE的传统模型,相 同之处是都是对web中元素计算尺寸的模型,不同之 处在于两者的计算方式不同。
w3c盒子模型的范围包括margin、border、padding、content,并且content部分不包含其他部分,IE盒子模型的 范围包括margin、border、 padding、 content,和w3c盒 子模型不同的是,IE盒子模型的content部分包含了padding和border
.box{ border:20px solid; padding:30px; margin:30px; background:red; width:300px; } /* 标准模型 空间宽度 = 300 + 20*2 + 30*2 + 30*2 */ /* IE的传统模型 空间宽度 = 300 + 30*2 */ /* IE的传统模型中的width是包括了padding和border的,而标准模型不包括,不管padding和borde加多少内容区域的宽度不会改变。 */
##### 1.5.1 content- -box
默认值,其让元素维持W3C的标准盒模型,也就是说元素的宽度和高度(width/height)等于元素边框宽度 (border)加上元素内距(padding) 加. 上元素内容宽度或 高度( content width/ height ), 也 就是element width/height = border + padding + content width /height
重新定义CSS2.1中盒模型组成的模式,让元素维持IE传统的 盒模型(IE6以下版本和IE6- -7怪异模式),也就是说元素的宽度或高度等于元素内容的宽度或高度。从上面盒模型介绍可知,这里的内容宽度或高度包含了元素的borderpadding、内容的宽度或高度(此处的内容宽度或高度=盒 子的宽度或高度一边框一-内距) 。
box-sizing: content-box
box-sizing: border-box
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: