Log in

View Full Version : Controlling image backgrounds



jelijo
01-16-2008, 03:20 PM
I have created a web page and placed a photo as a background. However depending on the computer I am viewing it on, it looks different. On one, the photo takes up the entire screen. On the second larger monitor, the photo repeats. Is there a way to control this so that it looks the same on all monitors
The site is at http://lasvegas08.vacations.jelijo.com/

BLiZZaRD
01-16-2008, 04:40 PM
Well, if the image is smaller than the screen size it will repeat unless you use CSS and tell it not too. Or upload a larger picture.

For CSS you can use the no-repeat option in your body style:



<style type="text/css">
<!--
body {background-image: url(images/filename.gif); background-repeat: no-repeat;}

-->
</style>


That would go in the head section. Oh, and you only need one <body> tag ;)

jelijo
01-16-2008, 04:48 PM
Thanks
But if I upload a larger picture and view it on a smaller monitor then you don't see the entire picture

BLiZZaRD
01-16-2008, 05:47 PM
And thus the battle begins... The other option is to center the background image and use a well suited color or gradient as the surrounding background for larger screen monitors.

jelijo
01-16-2008, 06:37 PM
So I assume there actually is no answer

BLiZZaRD
01-18-2008, 06:29 PM
There are lots of answers, you just have to pick one. There is always "detect the res and display picture X based on that" method, the centering method I mentioned above, the smaller picture titled method, the larger picture cut off method. Lots.. just have to pick the lesser of the evils.

jelijo
01-18-2008, 08:52 PM
In the end I turned the image into a watermark background so that it stays centred no matter screen size