How to create a full-page (cover) background image using CSS
Using CSS, you can display beautiful background images that span the entirety of the user's window -- regardless of their resolution. Here's how to do it.
Posted in these interests:
Using CSS, you can display beautiful background images that span the entirety of the user's window -- regardless of their resolution. Here's how to do it.
Upload your background image onto your web server. I recommend a background photo of at least 1200px in width.
html {
background: url('images/bg.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
To add support for older versions of Internet Explorer, add the following lines:
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.myBackground.jpg', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myBackground.jpg', sizingMethod='scale')";
Once you've set the background image, check out this guide to learn how to attach a CSS stylesheet to an HTML document.
The 1980s offered the world a different type of horror than had been seen before, or since.