my body
has a tiled background (blueness in attached image)
I need to horizontally centre some fixed width and height content (greenness), a fixed distance from the top of the page.
I then need to continue the background image of the centred content to the left and right extremities of the page, however wide the browser is (the purple)
The reason for this is that the green content has a "hole" in it, which allows the body
background to show through. If this wasnt a requirement id make the purpleness a 100% width div which wraps the content, and simply give it the tiled background image.
So far i've managed this:
<div id="Left"></div>
<div id="Right"></div>
<div id="Content"></div>
#Left
{
width: 50%;
margin-right: 480px;
position: absolute;
top: 50px;
right: 50%;
height: 525px;
background: transparent url(/images/purple.png) repeat-x scroll center top;
}
#Right
{
width: 50%;
margin-left: 480px;
position: absolute;
top: 50px;
left: 50%;
height: 525px;
background: transparent url(/images/purple.png) repeat-x scroll center top;
}
#Content
{
position: absolute;
top: 50px;
left: 50%;
margin-left: -480px;
width: 960px;
height: 525px;
background: transparent url(/images/green.png) no-repeat scroll center top;
}
Which does work, except the page has a horizontal scroll bar with the right hand purpleness extending for some way. How can i overcome this?
I can't spoof the hole by simply duplicating the background, and i'd like to avoid putting an overflow-x: hidden
on the body.
Edit: I also need to have a variable height page, as the given 525px height
may be much larger and therefore the page will need to v-scroll.
This needs to work in IE7+, FF, Safari
Thanks