You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. 如果 position 属性为 static 或 relative ,包含块就是由它的最近的祖先块元素(比如说inline-block, block 或 list-item元素)或格式化上下文(比如说 a table container, flex container, grid container, or the block container itself)的内容区的边缘组成的。
2. 如果 position 属性为 absolute ,包含块就是由它的最近的 position 的值不是 static (也就是值为fixed, absolute, relative 或 sticky)的祖先元素的内边距区的边缘组成。
3. 如果 position 属性是 fixed,包含块就是由 viewport (in the case of continuous media) 。
概述
文档中每一个元素在页面布局结构中均呈现为一个矩形的盒子,包括块元素和行内元素。
1. 盒模型
有时候也被成为框模型。
基础特性:
高级特性:
通过display设置显示类型:
2. 包含块
一个元素的尺寸和位置经常受其包含块的影响。
3. 垂直外边距合并
发生的条件:
4. 块格式化上下文(BFC)
创建块格式化上下文的方式:
块格式化上下文包含创建它的元素内部的所有内容。
用处:
5. 盒子阴影
box-shadow属性有四个值:
可以声明多个盒子阴影,用逗号隔开。
box-shadow还可以设置五个值,并在第一个值设置为inset,使它成为内部阴影。
6. 过滤器
CSS过滤器提供了一种过滤元素的方法,就好比你在诸如Photoshop这样的平面设计程序中过滤元素一样。
参考:
盒模型
包含块
垂直外边距合并
块格式化上下文
Filter
The text was updated successfully, but these errors were encountered: