Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the solution I finally came up with when using a div as a container for a dynamic background.</p> <ul> <li>Remove the <code>z-index</code> for non-background uses.</li> <li>Remove <code>left</code> or <code>right</code> for a full height column.</li> <li>Remove <code>top</code> or <code>bottom</code> for a full width row.</li> </ul> <p><strong>EDIT 1:</strong> CSS below has been edited because it did not show correctly in FF and Chrome. moved <code>position:relative</code> to be on the HTML and set the body to <code>height:100%</code> instead of <code>min-height:100%</code>.</p> <p><strong>EDIT 2:</strong> Added extra comments to CSS. Added some more instructions above.</p> <p>The CSS:</p> <pre><code>html{ min-height:100%;/* make sure it is at least as tall as the viewport */ position:relative; } body{ height:100%; /* force the BODY element to match the height of the HTML element */ } #cloud-container{ position:absolute; top:0; bottom:0; left:0; right:0; overflow:hidden; z-index:-1; /* Remove this line if it's not going to be a background! */ } </code></pre> <p>The html:</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;body&gt; &lt;div id="cloud-container"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Why?</p> <pre><code>html{min-height:100%;position:relative;} </code></pre> <p>Without this the cloud-container DIV is removed from the HTML's layout context. <code>position: relative</code> ensures that the DIV remains inside the HTML box when it is drawn so that <code>bottom:0</code> refers to the bottom of the HTML box. You can also use <code>height:100%</code> on the cloud-container as it now refers to the height of the HTML tag and not the viewport.</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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