I have and old treasure map graphic i would like to use as a background.
I am unsure on how to get the edging of the graphic to stick to the viewport edges while allowing the background to adjust according to the viewers browser.(graphic is just a texture and has no focal point)
any idea on the most straight forward way of tackling this?
You can’t do this with current CSS2 as a true background image, though CSS3 will offer this feature (which works in a few browsers now). You could put the image in the HTML and set it to width: 100%; but that won’t look good in some browsers, and it can get a bit messy, too. Another option is to use JavaScript, with something like Supersized.
Basically what you’d do is slice the image up so that only the main middle texture is your body {background-image:url(‘etc.jpg’);}. Then, with the four sides around, you can use them as alternate background images and repeat-x and repeat-y (for whatever works) so that they look nice.
Like so (CSS):
body
{
background-image:url('maintexture.jpg');
}
#Leftbackgroundimageborder
{
background-image:url('leftborder.jpg');
background-repeat:repeat-y; /*You want it up and down because it's the left side border*/
}
#topbackgroundimageborder
{
background-image:url('rightborder.jpg');
background-repeat:repeat-x;
}
You need to tell us what method you are using, or better, provide a link so we can see what you are doing. Did you see my post above? It has a link to a method which you can basically cut and paste. Has content overlaid on image.