background image and variable page sizes (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets and Accessibility



Message


paul rayner -> background image and variable page sizes (8/2/2009 17:29:08)

I have a background image - 874 x 1px. It has a blank spot in it 800px wide, with a gradient either side..

If I want to use that as a background, holding a container 800px wide, how can I do that for varying screen resolutions.
So far I have:
body {
background-image:url(images/page_background.gif);                  
background-repeat:repeat-y;
background-position:center;
}
#container {
width: 800px;
margin: 0 0 0 235px;
background-color:#990033;
}

#nav {
width: 200px;
margin: 0 20px 0 0;
float: left
}

#content {
width: 600px;
float:left;
margin: 0 0 200 0;
}

#footer {
float: left;
width: 800px;
}

but that doesn't take into account resoltions other than my 1280 wide. Should I be using percentages or????
Cheers

[image]local://upfiles/131/120085DDEC15470FBA08BA62C07DF824.gif[/image]




Tailslide -> RE: background image and variable page sizes (8/3/2009 2:33:45)

Not sure what you're after. Do you want the containing div to expand and contract? If so yes you need percentages.

Do you want to stick with the fixed width divs but have the background image work for larger screen widths? If so - just give the div a background colour equivalent to the background image surround and that will work.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125