确定CSS中的包含块也确定就是元素的父元素。关键是:看元素是如何定位的。确定包含块很重要,比如设置百分比。另外也可以进行样式的继承等等。
分两个情况:
静态定位(默认)和相对定位的父元素都是最近的父元素。
绝对定位和固定定位会脱离文档流,他们的包含块是距离它最近的定位祖先。
浮动元素包含块就是最近的父元素,没有特殊意义。