View Full Version : Centering Background


Andyman
02-23-2003, 02:18 PM
How can I make a background centered, instead of tiled? I'd also like it to be "fixed" too. And if a background is centered, will the unused space around it show the original page colour? Thanks.

StyGomez
02-23-2003, 02:22 PM
http://www.lissaexplains.com/css.shtml tells you exactly how.

<style>body
{ background-color: #000000;
background-image:url(value); [url of background image to be used, i.e. background.gif]
background-repeat:value; [repeat, no-repeat, repeat-x, repeat-y]
background-position:valueI valueII; [valueI: top, center, bottom, percentage, pixel number]
[valueII: right, center, left, percentage, pixel number]
background-attachment: [scroll, fixed]
</style>

Yep, if your background isn't tiled space shows around it, your chosen background color will show :)