我遇到了IE7問題。內聯塊塊容器內的塊元素未被拉伸以適合容器寬度。IE7中的內嵌塊容器內的100%寬度塊
代碼:
<div class="a">
<div class="b"></div>
<div class="c"></div>
</div>
.a {
border: 5px solid blue;
display: inline-block;
*display: inline;
zoom: 1;
}
.b {
width: 500px;
height: 10px;
background: green;
}
.c {
height: 10px;
background: red;
}
這裏被期望的行爲出現在其他瀏覽器:
以下是我在IE7有:
例子: http://jsfiddle.net/Lnfwezm4/5/
直接鏈接: http://fiddle.jshell.net/Lnfwezm4/5/show/
如何在IE7中實現紅色塊以適應父寬度(IE6會很棒)?
加入顯示:塊;以.b和.c和寬度:500px;到.c作品? – Monte 2014-10-06 17:39:19
@Monte,不能那樣做。那就是問題所在。 – panfil 2014-10-06 21:38:13