+ -
当前位置:首页 → 问答吧 → 关于css中的包含块。

关于css中的包含块。

时间:2011-03-10

来源:互联网

今天看关于css中关于包含块的问题

对于一个没有定位的元素(也就是 position:static),css2.1中的定义是:“For other elements, if the element's position is 'relative' or 'static', the containing block is formed by the content edge of the nearest block container ancestor box. ” 即:由离它最近的祖先块级元素的内容框所创建。

但是我在查阅国内的资料的时候,定义的是:它的包含块由它最近的块级、单元格(table cell)或者行内块(inline-block)祖先元素的内容框创建。

这里就有点模糊了,到底包不包括行内块(inline-block)呢?

作者: colin1215   发布时间: 2011-03-10

包括。你随便写几个简单的例子验证一下就知道了。越明显的事实,越没法讲道理。

作者: theforever   发布时间: 2011-03-10