Center a background image, no repeating / tiling

  • Thread starter Thread starter Steve Grosz
  • Start date Start date
S

Steve Grosz

Can someone tell me what the html code would be to have a wallpaper
image on a page, centered on the page, with no tiling/repeating? I've
looked in some FP books I have, and haven't been able to find anything.

This isn't going on a HTML page but on a ColdFusion page, so I can't
edit the page with the editing tools of FP2003, that's why I'm asking.

Thanks,
Steve
 
This requries the following CSS rule.

body { background-image: url('images/whatever.jpg');
background-repeat: no-repeat;
background-position: center }

You can put this rule in a <style></style> block in the
<head> section of your Web page, or preferably, in a
linked style sheet file.

I can't help you with ColdFusion, though. Try one of the
macromedia.coldfusion.* newsgroups.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
A while ago somebody (can't remember who) gave me a tip to set your own
browsers default background to a repulsive colour to remind yourself to
always set a background colour - even if you have an image as well. I'd do
body{
background: #fff url(image.gif) fixed center no-repeat;
}
 
Back
Top