Forum Moderators: phranque

Message Too Old, No Replies

resolutions

How do I make my backgrounds be the same 4 dif res

         

psych

9:01 pm on Sep 15, 2003 (gmt 0)



what program or commands for html do I need to use so that the background on my web page come up the same size on diferrent resolutions.

keyplyr

7:26 am on Sep 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld [webmasterworld.com] Psych.

2 considerations - does the image need to expand, maintaining it's ratio, example: a photo? Then you may need to develope seperate images and serve seperate pages via a screen size sniffer script.

The other option is to create an image that displays well when tiled (repeated.) Usually .gif, .png or .bmp files work best. Then set the image in the body and as the body conforms to different screen resolutions, so will the background.

It depends on what technique you wish to use. You can do it the old fashion way and reference the image file in the <body> tag, example:

<body link="#XXXXXX" vlink="#XXXXXX" background="background.gif">

But most people now follow the new standard of separating the page style, using CSS.

<body link="#XXXXXX" vlink="#XXXXXX" style="background:#XXXXXX url(http://www.your-site.com/background.gif);">

This CSS code may be placed in the <head> section:

<style>
body {
background:#XXXXXX url(http://www.your-site.com/background.gif);
color:#000;
top:0;
left:0;
margin:0;
padding:0;
}
</style>

Alternatively, the above code may be place in an external CSS file and linked to from the <head> section (in which case the style tags are not needed.)

<link rel="stylesheet" type="text/css" href="/style.css">

Since background images can be large and take a bit of time to load, it's recommended to precede the image with a similar color that loads very quickly and achieves the look you want.