Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Centered image that's wider than browser window Reply To: Centered image that's wider than browser window

#147833
lschoen114
Participant

So what you’re going to want to do is start with the div with a width of 100%. In that particular case, the width is 100% and the height is 500px.

Then you use make the background:

#div class {
background: url(http://evablackdesign.com/wp-content/uploads/2013/02/homepage-3.png) center center no-repeat;
}

In this case, since you don’t want to image size to change, make sure you set a min-width for the image, or let it stop at some number that you choose. (Like if you don’t need it to go beyond 1920px wide)