IE6下,子元素的宽高超过了父元素,父元素会被撑开

IE6下,子元素的宽高超过了父元素,父元素会被撑开,看下面的代码

<div class="box">
    <div class="content"></div>
</div>
.box{
    width: 200px;
    hegight: 200px;
    border 10px #000 solid;
}
.content{
    width: 400px;
    height: 400px;
    background-color: #ccc;
}

在IE6下,box的元素的宽度会变成400px;

对应的解决方案居然是:不要让子级的宽高超过父级,我也是醉了

猜你喜欢

转载自blog.csdn.net/qq_36800701/article/details/79859085
今日推荐