प्रश्न:एचटीएमएल: iframe तत्वों के बीच अजीब जगह?
निम्न 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>
यह बिल्कुल renders के रूप में एक उम्मीद होती है (क्रोम + IE8)।
लेकिन अब, मैं जोड़ें:
<!DOCTYPE html>
यह की चोटी पर।
और अचानक, मुझे क्रोम और आईई 8 (फ़ायरफ़ॉक्स का परीक्षण नहीं किया गया है) में दो iframe
एस (फ़ोल्डर सामग्री/ईमेल सामग्री) के बीच 2 से 5 मिमी हरी जगह मिलती है। क्या और भी अधिक परेशान करने वाला है, इस अंतरिक्ष से छुटकारा पाने के (<!DOCTYPE html>
हटाने से सिवाय कोई रास्ता नहीं हो रहा है।
क्यों? मेरा मतलब है, हरे रंग की पेरेंट तत्व की background-color
से आता है, लेकिन क्यों वहाँ कुछ है दो iframe
रों के बीच की जगह?
मुझे इसे मारो :) – robertc
अब मुझे एक बहुत कठिन सवाल का जवाब दें: _Why_ iframe 'display: inline' डिफ़ॉल्ट रूप से है? – PaulSkinner