Forums

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

Home Forums CSS How to allow a div with a bg-image to go negative left? Re: How to allow a div with a bg-image to go negative left?

#79774
Amida
Participant

I think I’ve found the solution:

Here is the magic: min-width on body and html tag.

Code:
body{
font-family:Arial,Helvetica,sans-serif;
background:url(../images/background.jpg) no-repeat #000;
background-position: top center;
min-width:960px; /** <<<—– this ! **/
}

html{
min-width:960px; /** <<<—– this ! **/
}

#content{
position:relative;
width:960px;
height:1126px;
margin:auto;
background:url(../images/bg.png) repeat-y;
}

You can see it there:

http://anju.be/test/solution/