Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML DIV and IMG tag spacing in IE vs. FF
    primarykey
    data
    text
    <p>I'm having trouble with the layout of a simple HTML page. Please help.</p> <p>Here's the layout I'm going for...</p> <p><a href="http://img516.imageshack.us/img516/9637/layoutfk5.gif" rel="nofollow noreferrer">Layout http://img516.imageshack.us/img516/9637/layoutfk5.gif</a></p> <ul> <li>orange = body</li> <li>blue/red = frame div</li> <li>green = header image</li> <li>black/white = menu div</li> </ul> <p>It looks correct in Internet Explorer, but in Firefox, Safari, and Chrome there's a 4-pixel gap between my image (header) and my div (menu).</p> <p>Internet Explorer, Firefox, Safari, and Chrome...</p> <p><a href="http://img516.imageshack.us/img516/3292/browserszi8.gif" rel="nofollow noreferrer">Browsers http://img516.imageshack.us/img516/3292/browserszi8.gif</a></p> <p>This is my HTML...</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt; &lt;html&gt; ... &lt;body&gt; &lt;div id="frame"&gt; &lt;img id="header" src="images/header.jpg" width="700" height="245" alt="" /&gt;&lt;div id="menu"&gt; &lt;strong&gt;One&lt;/strong&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="two.html"&gt;Two&lt;/a&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="three.html"&gt;Three&lt;/a&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="four.html"&gt;Four&lt;/a&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="five.html"&gt;Five&lt;/a&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="six.html"&gt;Six&lt;/a&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="seven.html"&gt;Seven&lt;/a&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="eight.html"&gt;Eight&lt;/a&gt; &amp;nbsp;|&amp;nbsp; &lt;a href="nine.html"&gt;Nine&lt;/a&gt; &lt;/div&gt; &lt;div id="content"&gt; ... &lt;/div&gt; ... &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Notice there's no whitespace between the IMG and the menu DIV.</p> <p>This is my CSS...</p> <pre><code>... div#frame { background: #FF0000; margin-right: auto; margin-left: auto; width: 700px; border: 5px #30AADE solid; } div#frame img#header { margin: 0; padding: 0; border: 0; } div#frame div#menu { margin: 0 auto 0 auto; padding: 5px 0 5px 0; border-top: solid 2px #FFFFFF; text-align: center; font-size: small; color: #88BE34; background-color: #000000; } div#frame div#menu strong { font-size: medium; color: #FFFFFF; } div#frame div#menu a { color: #88BE34; } </code></pre> <p>Why are Firefox, Safari, and Chrome showing that 4-pixel gap?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload