Note that there are some explanatory texts on larger screens.

plurals
  1. POWrong simple div layout in IE9
    primarykey
    data
    text
    <p>Why won't IE9 position the <code>Orange</code> div next to the <code>Blue</code> one? The divs render just fine in other more civilized browsers, like Chrome or Firefox. The width values match perfectly, including the margins, but it takes extra 4 pixels to be removed from the e.g. <code>Gray</code> div in order to make the <code>Orange</code> one appear next to the <code>Blue</code> in IE9 (which leaves 4 pixels gap to the right of the <code>Orange</code> one, of course).</p> <pre><code>&lt;div style="margin-top: 100px; background-color: GreenYellow; width: 740px; height: 100px; padding: 0px; overflow: visible;"&gt; &lt;div style="background-color: CadetBlue; width: 210px; height: 100px; margin: 0px; padding: 0px; float: left; overflow: visible;"&gt; &lt;/div&gt; &lt;div style="background-color: Black; width: 100px; height: 100px; margin: 0px 0px 0px 4px; padding: 0px; float: left; overflow: visible;"&gt; &lt;/div&gt; &lt;div style="background-color: FireBrick; width: 318px; height: 100px; margin: 0px 0px 0px 4px; padding: 0px; float: left; overflow: visible;"&gt; &lt;div style="background-color: LightSalmon; width: 318px; height: 48px; margin: 0px; padding: 0px; overflow: visible;"&gt; &lt;!-- Gray --&gt; &lt;div style="width: 214px; height: 48px; margin: 0px 0px 0px 0px; padding: 0px; float: left; background-color: #333333; overflow: visible;"&gt; &lt;/div&gt; &lt;!-- Blue --&gt; &lt;div style="width: 48px; height: 48px; margin: 0px 0px 0px 4px; padding: 0px; float: left; background-color: #00A8EC; overflow: visible;"&gt; &lt;/div&gt; &lt;!-- Orange --&gt; &lt;div style="width: 48px; height: 48px; margin: 0px 0px 0px 4px; padding: 0px; float: left; background-color: Orange; overflow: visible;"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="background-color: Gainsboro; width: 318px; height: 48px; margin: 4px 0px 0px 0px; padding: 0px; overflow: visible;"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="background-color: Purple; width: 100px; height: 100px; margin: 0px 0px 0px 4px; padding: 0px; float: left; overflow: visible;"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>So how do I fix this? It's killing me ...</p> <p>Fiddle: <a href="http://jsfiddle.net/LE6cy/" rel="nofollow">http://jsfiddle.net/LE6cy/</a></p> <h3>Update</h3> <p>Ok, I had no idea that this would affect it, but there is one more thing that I have on the page before these divs. It's a plain table. It seems that once the table is there, the error appears. So here is the whole HTML page (for real):</p> <pre><code>&lt;table id="signature" cellspacing="4" cellpadding="0" style="width: 750px; height: 100px; border: 0px;"&gt; &lt;tr&gt; &lt;td rowspan="2" style="height: 100px; width: 210px; background-color: #336666;"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;div style="margin-top: 100px; background-color: GreenYellow; width: 740px; height: 100px; padding: 0px; overflow: visible;"&gt; &lt;div style="background-color: CadetBlue; width: 210px; height: 100px; margin: 0px; padding: 0px; float: left; overflow: visible;"&gt; &lt;/div&gt; &lt;div style="background-color: Black; width: 100px; height: 100px; margin: 0px 0px 0px 4px; padding: 0px; float: left; overflow: visible;"&gt; &lt;/div&gt; &lt;div style="background-color: FireBrick; width: 318px; height: 100px; margin: 0px 0px 0px 4px; padding: 0px; float: left; overflow: visible;"&gt; &lt;div style="background-color: LightSalmon; width: 318px; height: 48px; margin: 0px; padding: 0px; overflow: visible;"&gt; &lt;!-- Gray --&gt; &lt;div style="width: 214px; height: 48px; margin: 0px 0px 0px 0px; padding: 0px; float: left; background-color: #333333; overflow: visible;"&gt; &lt;/div&gt; &lt;!-- Blue --&gt; &lt;div style="width: 48px; height: 48px; margin: 0px 0px 0px 4px; padding: 0px; float: left; background-color: #00A8EC; overflow: visible;"&gt; &lt;/div&gt; &lt;!-- Orange --&gt; &lt;div style="width: 48px; height: 48px; margin: 0px 0px 0px 4px; padding: 0px; float: left; background-color: Orange; overflow: visible;"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="background-color: Gainsboro; width: 318px; height: 48px; margin: 4px 0px 0px 0px; padding: 0px; overflow: visible;"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="background-color: Purple; width: 100px; height: 100px; margin: 0px 0px 0px 4px; padding: 0px; float: left; overflow: visible;"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    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