How to create a full-page (cover) background image using CSS

How to create a full-page (cover) background image using CSSHow to create a full-page (cover) background image using CSS
Zach Zach (233)
Total time: 5 minutes 
Updated: August 9th, 2015

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:

webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides

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')";

How to create a full-page (cover) background image using CSS

How to create a full-page (cover) background image using CSSHow to create a full-page (cover) background image using CSS
Zach Zach (233)
Total time: 5 minutes 
Updated: August 9th, 2015

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:

webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides

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')";

How to create a full-page (cover) background image using CSS

How to create a full-page (cover) background image using CSSHow to create a full-page (cover) background image using CSS
Zach Zach (233)
Total time: 5 minutes 
Updated: August 9th, 2015

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:

webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides

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')";

How to create a full-page (cover) background image using CSS

How to create a full-page (cover) background image using CSSHow to create a full-page (cover) background image using CSS
Zach Zach (233)
Total time: 5 minutes 
Updated: August 9th, 2015

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:

webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides

How to create a full-page (cover) background image using CSS

webdesignwwwcss
Zach Zach (233)
Total time: 5 minutes 
Updated: August 9th, 2015
Zach
 

Posted in these interests:

webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides
webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides
PRIMARY
Calling all writers!

We’re hiring. Write for Howchoo

 
In these interests
webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides
webdesign
PRIMARY
18 guides
www
5 guides
css
4 guides
PRIMARY

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')";

Upload your background image onto your web server. I recommend a background photo of at least 1200px in width.

Upload your background image onto your web server. I recommend a background photo of at least 1200px in width.

Upload your background image

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;
}
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;
}

Paste the following in your CSS file

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')";

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')";

Add old version IE support (optional)

Calling all writers!

We’re hiring. Write for Howchoo

Zach's profile pictureZach
Joined in 2015
Web developer, designer, tinkerer, and beer enthusiast living in Tampa, Florida.
Zach's profile picturehowchoo
Share this guide!
RedditEmailTextPinterest
Related to this guide:
SVG Optimization: How (and Why) to Optimize SVGsSVG Optimization: How (and Why) to Optimize SVGs
SVGs are great; making them smaller makes them even greater. This guide will show you how to optimize SVGs.
Zach's profile picture ZachView
In these interests: svgwebdesignwebdev
Use Chrome Developer Tools to Check Whether Resources Are Loading over SSLUse Chrome Developer Tools to Check Whether Resources Are Loading over SSL
In the wake of Google’s announcement that it will start giving a ranking boost to full-SSL sites, many companies are converting their sites to be full-https.
Zach's profile picture ZachView
In these interests: chromewebdesignwebdev
Make your lightbox display over an embedded YouTube video in IE8Make your lightbox display over an embedded YouTube video in IE8
In Internet Explorer 8, embedded YouTube videos are treated as the absolute top element, regardless of z-index.
2paclives's profile picture 2paclivesView
In these interests: webdesign
SVG Optimization: How (and Why) to Optimize SVGsSVG Optimization: How (and Why) to Optimize SVGs
SVGs are great; making them smaller makes them even greater. This guide will show you how to optimize SVGs.
Zach's profile picture ZachView
In these interests: svgwebdesignwebdev
Zach's profile pictureViewsvgwebdesignwebdev
Use Chrome Developer Tools to Check Whether Resources Are Loading over SSLUse Chrome Developer Tools to Check Whether Resources Are Loading over SSL
In the wake of Google’s announcement that it will start giving a ranking boost to full-SSL sites, many companies are converting their sites to be full-https.
Zach's profile picture ZachView
In these interests: chromewebdesignwebdev
Zach's profile pictureViewchromewebdesignwebdev
Make your lightbox display over an embedded YouTube video in IE8Make your lightbox display over an embedded YouTube video in IE8
In Internet Explorer 8, embedded YouTube videos are treated as the absolute top element, regardless of z-index.
2paclives's profile picture 2paclivesView
In these interests: webdesign
2paclives's profile pictureViewwebdesign
People also read:
Most people don’t know that you can look up past “snapshots” of almost any website. Archive.org is a 501(c)(3) nonprofit organization that was formed to build an expansive Internet library.
Internet Explorer 8 may display a border regardless of your CSS attempts. This guide details how to remove it once and for all.
Text shadows are a beautiful and subtle effect for your web site. CSS3 text shadows are currently support on all versions of Chrome, Safari, Firefox 3.5+, and IE 10+.
Learn how to center text in CSS.
If you’re the administrator of a Facebook Page for your business (or whatever), you can still comment as yourself.
When building a website, it’s a good idea to open external links (e.g. http://google.com) in a new window so that users aren’t directed away from your site.
If you’d like your visitors to be able to open a phone application straight from your website you can follow this quick guide.
If you have a log file that gets written to frequently, you will want to add it to logrotate so it doesn’t consume all of your disk space.
iPhone on Book of Fonts
Really love that font you found in a book or website? Learn how to tell what it is.
BEM
Naming things is hard. “There are only two hard problems in Computer Science: cache invalidation and naming things.” — Phil Karlton Truer words were never spoken.
Most people don’t know that you can look up past “snapshots” of almost any website. Archive.org is a 501(c)(3) nonprofit organization that was formed to build an expansive Internet library.
Internet Explorer 8 may display a border regardless of your CSS attempts. This guide details how to remove it once and for all.
Text shadows are a beautiful and subtle effect for your web site. CSS3 text shadows are currently support on all versions of Chrome, Safari, Firefox 3.5+, and IE 10+.
Learn how to center text in CSS.
If you’re the administrator of a Facebook Page for your business (or whatever), you can still comment as yourself.
Time Travel the Internet: View Any Website from (Almost) Any Year
How to remove an iFrame border in IE8
CSS Text Shadows: How to Add a Text Shadow Using CSS3
Center align text using CSS
How to Comment on Your Facebook Page as Yourself
When building a website, it’s a good idea to open external links (e.g. http://google.com) in a new window so that users aren’t directed away from your site.
If you’d like your visitors to be able to open a phone application straight from your website you can follow this quick guide.
If you have a log file that gets written to frequently, you will want to add it to logrotate so it doesn’t consume all of your disk space.
iPhone on Book of Fonts
Really love that font you found in a book or website? Learn how to tell what it is.
BEM
Naming things is hard. “There are only two hard problems in Computer Science: cache invalidation and naming things.” — Phil Karlton Truer words were never spoken.
How to open a link in a new window (HTML)
How to open the telephone app using an HTML link
How to add a file to logrotate on Linux
iPhone on Book of Fonts
iPhone on Book of FontsHow to Find Out What Font is Being Used
BEM
BEMAn Introduction to BEM, How It Works, and Why It’s Awesome
Posted in these interests:
PRIMARY
ExploreExploreExplore
Discuss this guide:
We’re hiring!
Are you a passionate writer? We want to hear from you!
We’re hiring!
Are you a passionate writer? We want to hear from you!
View openings

Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.

Donate