Sunday, November 19, 2017

Full-Page Background Image CSS

Using CSS3, the following can be used for most modern browsers to produce full-page background image.
html {
  background-image: url('images/background-image.jpg') no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
Make sure to start the style with background-image: url(''). This style should work with IE9 or above.