拥有overflow:hidden样式的块元素不具有position:relative和position:absolute样式;
内部溢出的元素是通过position:absolute绝对定位,并且该定位元素的包含块是设置overflow:hidden元素的父级元素
html,
body {
margin: 0;
}
.over-hidden{overflow:scroll; height:100px; font-size:14px; width:100px; border:2px dotted #ddd;}
.outer{position:relative}
.inner1{position:absolute; top:0;height: 200px; background:yellow;}
.inner2{position:absolute; top:200px; background:pink;}
相关文章
发表评论