how to fix background image in full width in htmal css.

Status
Not open for further replies.
2 comments
as per my understanding, you have a background image which is wide enough and you want it to make it center for all resolution browsers.
CSS 3 FTW!

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




Works in:

  • Safari 3+
  • Chrome Whatever+
  • IE 9+
  • Opera 10+ (Opera 9.5 supported background-size but not the keywords)
  • Firefox 3.6+ (Firefox 4 supports non-vendor prefixed version)


 
Status
Not open for further replies.
Back
Top