这里红色框是没有设置任何溢出属性的父div。橙色和灰色的盒子是它的孩子。我想知道的是,一个孩子是否有可能溢出另一个孩子不溢出?
.rootdiv {
width: 300px;
height: 300px;
background: red;
border: solid;
position: relative;
overflow: hidden;
}
.rootdiv .not-overflow {
border: dashed;
background: orange;
position: relative;
left: 20px;
}
.rootdiv .must-overflow {
border: dashed;
background: gray;
position: relative;
top: 20px;
left: 20px;
}
<div class="rootdiv">
<div class="not-overflow">
This must get chopped.
</div>
<div class="must-overflow">
This must overflow.
</div>
</div>
暮色呼如
红糖糍粑
www说
缥缈止盈
相关分类