Note that there are some explanatory texts on larger screens.

plurals
  1. PO2 divs that "should" have equal height, but one appears to be a pixel larger than the other
    primarykey
    data
    text
    <p>EDIT again: They appear to look the same at certain zoom levels, but zooming in and out reveals the discrepancy. FF's default zoom makes them look incorrect, Chrome's default looks OK but the discrepancy is revealed after zooming in.</p> <p>EDIT: here is a jsfiddle <a href="http://jsfiddle.net/eHRkb/" rel="nofollow">http://jsfiddle.net/eHRkb/</a></p> <p>Here is the situation: My base "unit" is a 50px x 50px square.</p> <p>I have a div that is 48x98 with a border of 1 for a total size of 50x100, so that is a 1x2.</p> <p>I have a div that is 48x48 with a border of 1 for a total size of 50x50, so that is a 1x1.</p> <p>I have a div that is 50x100 with 0 border, for a total size of 50x100. That is the 1x2 Container, intended to hold 2 1x1 divs.</p> <p>I want to display two 1x1s on top of each other, and a 1x2 immediately to the right. This is achieved by putting the 2 1x1 divs into the container, and both the 1x2 and 1x2 container are <code>float:left</code>, so it should look like this:</p> <pre><code>|[X]|| | |[X]|| | </code></pre> <p><strong>The problem I am having is that the left div, the container, appears to be 1 pixel shorter than the div on the right.</strong> They are both 100px in height, including borders, so I am not sure what is wrong, since their heights should be identical, right? Below is my CSS and HTML.</p> <p><strong>CSS</strong></p> <pre><code>.tile1x1 { width:48px; height:48px; float:left; } .tile1x2 { width:48px; height:98px; float:left; } .tile1x2Container { width:50px; height:100px; float:left; border:none; } .border1 { border:1px solid black; } </code></pre> <p><strong>HTML</strong></p> <pre><code>&lt;div class="tile1x2Container"&gt; &lt;div class="tile1x1 border1"&gt;&lt;/div&gt; &lt;div class="tile1x1 border1"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="tile1x2 border1"&gt;&lt;/div&gt; </code></pre> <p>Thanks for reading!</p>
    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