CSS 概念 Block Inline Containing block
Block 元素 包括 "block-level box," "block container box," and "block box"
首先 display有以下几个属性 inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit
block-level boxes: display 为 block | list-item | table
block container boxes: 当设置 display 为 block | list-item | inline-block | table | inline-table | table-cell | table-caption (自己测试总结)
block boxes: block-level boxes that are also block containers are called block boxes.
几点说明:
1. a block-level box is also a block container box
2. Not all block container boxes are block-level boxes, 比如 table-cell | inline-block
3. Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions) that are not block boxes
-----------------------------------------------------------------------------------
Inline 元素
Inline-level boxes: 当设置 display 'inline', 'inline-table', and 'inline-block'
Inline boxes: Inline-level boxes that are not inline boxes, 比如 'inline-table', and 'inline-block'
-----------------------------------------------------------------------------------
containing block
默认元素的 position 是 static。 其它属性有 relative, absolute, fixed
position: static | relative
the containing block is formed by the content edge of the nearest block container ancestor box.
position: fixed
the containing block is established by the viewport in the case of continuous media or the page area in the case of paged media.(跟它的包裹元素设置 position: relative 或 absolute 没有关系)
position: absolute:
If the element has 'position: absolute', the containing block is established by the nearest ancestor with a 'position' of 'absolute', 'relative' or 'fixed'.
If there is no such ancestor, the containing block is the initial containing block(initial C.B.).
如果所有元素都没有设置 position, 那么html 是 initial C.B. (UA-dependent)
参考文献:
http://www.w3.org/TR/CSS2/visuren.html#block-boxes
http://www.w3.org/TR/CSS2/visuren.html#propdef-display
http://www.w3.org/TR/CSS2/visuren.html#block-formatting
http://www.w3.org/TR/CSS2/visuren.html#inline-boxes
http://www.w3.org/TR/CSS2/visudet.html#containing-block-details
最新文章
- (转)java自带线程池和队列详细讲解 - CSDN过天的专栏
- java静态方法调用&;&;构造函数&;&;静态块
- Java for XML: JAXP、JAXB、JAXM、JAX-RPC、JAX-WS
- [荐]使用jQuery清空file文件域
- 新浪微博之XSS蠕虫脚本源码讲解
- win10 enterprise 10240激活:
- GridView多行标题行、改造标题行、自定义标题行完美版
- 阿里云学习之API网关
- 搭建Jetbrains家族IDE授权服务器
- adv生成控制器手腕位置倾斜原因以及解决方案
- docker遇到的问题以及docker 操作镜像的基本操作
- AutoMapper自动映射
- c++数组的引用
- oracle exadata一体机虚拟机
- hyperledge fabric里order-kafka过程分析
- 微信小程序:block的隐藏
- Parallel学习
- ASP.net--全局程序文件:Global.asax
- [Assembly]汇编编写简易键盘记录器
- (原创)AP6212蓝牙模块在am335x控制板上的应用