1
我很難搞清楚這一點。ie7孩子塊元素擴大和無視父母填充
我有一個塊內的另一個塊元素有一個底部填充(父)。子元素將其高度展開爲100%,同時吃掉/重疊父級的底部填充,就好像根本沒有填充。
什麼可能觸發這種行爲?
這裏的HTML代碼:
<span class="boxTop">
<span class="boxBottom">
<span class="boxLeft">
<span class="boxRight">
<span class="box">
Content goes here
</span>
</span>
</span>
</span>
</span>
這裏的CSS:
.infoBox .boxTop {
padding:20px 0 0 0;
display:block;
background:transparent url(images/infobox-top.png) repeat-x 0 0;
}
.infoBox .boxBottom {
padding:0 0 20px 0;
display:block;
background:transparent url(images/infobox-bottom.png) repeat-x 0 bottom;
}
.infoBox .boxLeft {
padding:0 0 0 20px;
display:block;
background:transparent url(images/infobox-left.png) repeat-y left 0;
}
.infoBox .boxRight {
padding:0 20px 0 0;
display:block;
background:transparent url(images/infobox-right.png) repeat-y right 0;
}
這是它看起來像在IE7:
這裏的boxBottom:http://img.photobucket.com/albums/v466/nemesis2k4/Forum%20Posts/boxbottom.jpg
和這裏的boxLeft和boxRight,都擴大和重疊/無視boxBottom的pa dding: http://img.photobucket.com/albums/v466/nemesis2k4/Forum%20Posts/boxleft.jpg http://img.photobucket.com/albums/v466/nemesis2k4/Forum%20Posts/boxright.jpg
請出示您的代碼,以便更好地理解 – sandeep 2011-05-02 11:42:28
由於您的HTML示例代碼包含五個元素,因此很難理解您引用「父」和「子」元素的元素。您的示例代碼中也沒有任何內容可以讓元素「將其高度展開100%」。你能更精確嗎?也許發佈一個**工作**的例子,例如jsfiddle.org – RoToRa 2011-05-02 13:02:02
對不起,我應該更具體。發佈編輯!謝謝 – DigitalDouble 2011-05-03 02:46:46