Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can set the div background through the CSS, that way the image will fill the div and the sides will cutoff when the div is resized smaller. This code will center the image within the div and cutoff at the edges when shrunken down:</p> <p>HTML:</p> <pre><code>&lt;div id="background"&gt;&lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>#background { position: absolute; min-height:100%; width: 100%; height: auto; top: 0; left: 0; background: url(http://2.bp.blogspot.com/-ayEwJpMGTPQ/USqliwPWo1I/AAAAAAAAHtI/ab6NHVy0Q48/s1600/tree.jpg) no-repeat center center; -webkit-background-size: cover; /* Add in these */ -moz-background-size: cover; /* four lines to */ -o-background-size: cover; /* remove the white space*/ background-size: cover; /* around images */ } </code></pre> <p><a href="http://jsfiddle.net/S59EW/11/" rel="nofollow">JSFiddle</a></p> <p>and <a href="http://jsfiddle.net/S59EW/11/embedded/result/" rel="nofollow">full screen JSFiddle</a></p> <p><a href="http://jsfiddle.net/S59EW/53/" rel="nofollow">Updated JSFiddle with background-size property included to remove white space</a></p> <p><a href="http://jsfiddle.net/S59EW/53/embedded/result/" rel="nofollow">Updated full screen version</a></p> <p><a href="http://jsfiddle.net/MxvQz/3/" rel="nofollow">Updated with slideshow</a></p> <p><a href="http://jsfiddle.net/MxvQz/3/embedded/result/" rel="nofollow">Updated fullscreen with slideshow</a></p> <p>You may need to play with the aspect ratio of the background photos in order to get the look you want.</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. 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