...

View Full Version : background picture on web



MCD4x4
05-29-2005, 12:26 AM
Hi Folks,

I tried to use a picture for a background but if viewed on a higher screen size it tiles. Here's the link maybe you can tell what I'm doing wrong. www.mcd4x4.com/alana.htm

_Aerospace_Eng_
05-29-2005, 12:56 AM
A background image will tile to fit the resolution unless you tell it not to. Would you want it centered and not to repeat?

<style type="text/css">
<!--
body {
background-image:url(alanaspage/3-19-05/page1.jpg);
background-position:center;
background-repeat:no-repeat;
background-color:#FFFFFF;
}
-->
</style>
you can add that in your head tags to make it not repeat, it will center on any resolution.

mark87
05-29-2005, 12:58 AM
If you want a non-repeating background - so it doesn't tile - then do something like so -

body {
background: url(picture.jpg) no-repeat;
}

Although, then in larger resolutions, the background will stop half way. I don't think you can stretch the background to cater for all resolutions.

EDIT: Darn, was beaten to it.

MCD4x4
05-29-2005, 01:01 AM
So than the css sounds like the way to go?

_Aerospace_Eng_
05-29-2005, 01:19 AM
css is the standards way to go, you could use the old html attributes like bgpropties="fixed" or bgcolor="blah" but thats deprecated and shouldn't be used. CSS should be used in place of it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum