Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS full page background scaling issues
    text
    copied!<p>How can I make a full page background image and not have it stretched (<a href="http://naczynia.welmax.pl/kontakt" rel="nofollow noreferrer">something like this</a>)? </p> <pre><code>&lt;html&gt; &lt;style&gt; html, body {height:100%;} #background { min-height:100%; min-width:1024px; width:100%; height:auto; position:fixed; top:0; left:0; z-index:-1; } @media screen and (max-width: 1024px){ #background{left:50%;margin-left:-512px;}} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;img id="background" src="http://www.iwallpapers.in/bulkupload/C/Mountains/Mountains%2040.jpg" alt="" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Pastebin <a href="http://pastebin.com/Ef5cGJMM" rel="nofollow noreferrer">here</a></p> <p><strong>EDIT:</strong></p> <p>The above code might illustrate my goal better. When you re-size the window to let's say 400px you get <a href="http://gyazo.com/45e516ae4ed2c27000e4c55381df94ea.png" rel="nofollow noreferrer">empty space under the image</a>. I want the image to fill the entire window and keep its aspect ratio. </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt;&lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;style&gt; *{margin:0; padding:0;} #wrap{ width:100%; height:auto; margin:0 auto; } #bg{ width:100%} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrap"&gt; &lt;img src="http://www.bmwgallery.co.uk/bmw-motorcycles/bmw-s1000rr-superbike-motorcycle-large.jpg" id="bg" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

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