Wednesday, 30 August 2006 - 4:24 PM EDT
Name:
cw
the answer is more complicated than you might think.
dalleh's method will not pixelize the image. It will not change the dimensions of the picture as uploaded in any way. it just prevents the image from tiling by fixing it in place. Tiling is what your BG image is doing now by repeating itself over and over on your page.
What you need to start with is an image of the proper size. What size is "proper" depends on the screen resolution the page is viewed in. How the image appears, and how much of it displays, depends on the number of pixels being displayed in any particular pc monitor.
The most common resolution being used right now is 1024 x 768.... but there are many others both larger and smaller. 1024 x 768 means 1024 pixels across and 768 pixels down. Using dalleh's code and an image a little smaller than those dimensions will cause the BG image to fill up most of a monitor in 1024x768 resolution when the page displays IN A MAZIMIZED BROWSER WINDOW. But the BG image must first be of the proper size when it is uploaded. Images of that size are usually of very large file weight so are not the best choice for a BG image because of the time it will take to load to the page. Smaller resolutions (like 800 x 600) will not display parts of the picture, particularly those parts to the right of the image that are beyond 780 pixels to the right or so. Larger resolutions will see blank space where your image ends. What resolution being used depends on what your visitor uses, not you.
So you have a bit to think about when choosing a BG image and how to display it as a BG on a page. An easier option is to create a BG image that will tile seamlessly. That is easiest to create if you go with a long (very wide), thinimage, maybe with your small image to the left and a solid color to it's right so the solid color displays where your content is likely to show. The image used for your BG would need to be wide enough to prevent L/R tiling in larger resolutions... an image at least 1200 pixels wide. Or you can go with a BG image to fit smaller resolutions and fix it as dalleh suggests.... except the resolution the page is viewed in will affect where your content displays in relation to the image for any particular visitor. That may make your content hard to view or read.
And in case it isn't clear, the image needs to be created and sized in an image editor and saved in a web image format like jpg gif or png that is uploadable to your site.
For what it's worth. a BG image is a *background*; meant to display in the *background*. They are generally insignificant elements used on a web page to enhance but not distract from it's content or slow down load time. If you just want people to view your images, don't use them as BG images unless you know exactly what you're doing. Instead, just insert them on the page in the usual way as in a photo album.