考慮下面的HTML:
<html>
<head></head>
<body>
<div style="float:left;">
<div style="background-color: Red; padding-top: 2mm; padding-bottom: 2mm;">
Dock: Usage controls/symbol list here
</div>
<div style="height: 300px; background-color: Khaki; display:block; float:left; overflow: scroll;">
<ul style="background-color: White; float: left; margin: 0px; padding: 0px; padding-left: 30px; padding-right: 10px;">
<li>
<a href="Folders/Content/Inbox" target="ifrmFolderContent" >
Posteingang/Inbox
</a>
</li>
<li>
<a href="Folders/Content/Drafts" target="ifrmFolderContent" >
Entwürfe/Drafts
</a>
</li>
<li>
<a href="Folders/Content/Sent Items" target="ifrmFolderContent" >
Gesendet/Sent Items
</a>
</li>
<li>
Archiv/Archive
</li>
<li>
Papierkorb/Trash
</li>
<li>
Junk/Crap
</li>
<li>
Scam
</li>
<li>
Spam
</li>
<li>
Virus
</li>
<li>
Abrufen/Send & Receive
</li>
<li>
Verfassen/Compose
</li>
<li>
Adressbuch/Address book
</li>
</ul>
</div>
<div style="width: 400px; height: 300px; background-color: Green; display:block; float:left; margin: 0px; padding: 0px;">
<iframe marginwidth="0" marginheight="0" hspace="0" vspace="0" name="ifrmFolderContent" src="http://www.yahoo.com" frameborder="0" style="overflow: none; width: 400px; height: 150px; background-color: Orange; margin: 0px; padding: 0px;">
Folder Content
</iframe>
<iframe marginwidth="0" marginheight="0" hspace="0" vspace="0" name="ifrmEmail" src="http://www.msn.com" frameborder="0" style="overflow: none; width: 400px; height: 150px; background-color: Orange; margin: 0px; padding: 0px;">
E-Mail Content
</iframe>
</div>
<div style="background-color: Indigo; padding-top: 2mm; padding-bottom: 2mm; clear: left;">
Copyright here
</div>
</div>
</body>
</html>
它使得恰好正如人們所預料器(Chrome + IE8)。
但現在,我補充一下:
<!DOCTYPE html>
在它的上面。
突然之間,我在Chrome和IE8中都沒有測試FireFox,在兩個iframe
s(文件夾內容/電子郵件內容)之間得到2到5毫米的綠色空間。 什麼是更令人不安的是,似乎沒有辦法擺脫這種空間的(除了刪除<!DOCTYPE html>
。
爲什麼呢?我的意思是,綠色來自於父元素的background-color
,但爲什麼會出現一些
打我吧:) – robertc
現在回答我一個更難的問題:_Why_默認情況下是iframe display:inline嗎? – PaulSkinner