Note that there are some explanatory texts on larger screens.

plurals
  1. POPosition Absolute: Negative Values
    primarykey
    data
    text
    <p>I am attempting to create a page that has four <code>div</code> containers that are each 100% width and 100% height. I want there to be a main <code>div</code> in the middle, and then one to its left, right, and bottom (yes they must be positioned like this for the sake of jQuery animations). </p> <p>The following is my current code (and here is a <a href="http://jsfiddle.net/MitulP91/P2rjV/" rel="nofollow">JSFiddle</a>):</p> <p><strong>HTML</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="stylesheets/test.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container1"&gt;&lt;/div&gt; &lt;div id="container2"&gt;&lt;/div&gt; &lt;div id="container3"&gt;&lt;/div&gt; &lt;div id="container4"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>html, body { height: 100%; width: 100%; margin: 0; padding: 0; /*overflow: hidden;*/ } #container1 { position: absolute; height: 100%; width: 100%; top: 0; left: 0; background-color: blue; } #container2 { position: absolute; height: 100%; width: 100%; top: 0; left: -100%; background-color: red; } #container3 { position: absolute; height: 100%; width: 100%; top: 0; left: 100%; background-color: green; } #container4 { position: absolute; height: 100%; width: 100%; top: 100%; left: 0; background-color: orange; } </code></pre> <p>I had no issue with the <code>div</code>s that are to the right and underneath, but I can't seem to get the one to the left working.</p> <p>I was also trying to position the left <code>div</code> at <code>left: 0</code> and <code>top: 0</code> with the main div at <code>left: 100%</code> and <code>top: 0</code>, but I am unsure of how to get the page to load viewing the main <code>div</code> (the blue one). An example of this is at <a href="http://jsfiddle.net/MitulP91/zGzLM/" rel="nofollow">this JSFiddle</a>.</p> <p>Any ideas?</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.
 

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