Skip to content
WJunction - Webmaster Forum

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

Status
Not open for further replies.
if i have a layout with a full width background, how to manage it efficiently in css and html. i need it in full width.
 

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.

About the author

W
Member · Joined
5
Messages
0
Reactions
1
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom