Forum Moderators: not2easy

Message Too Old, No Replies

Problem with Background Image

won't display...

         

Stargazer

2:32 am on Sep 25, 2004 (gmt 0)

10+ Year Member



I'm creating a CSS in Frontpage. If I make changes to the font, the font changes display on my index page.

However, the background-image is hanging me up:

body {background-image: url(images/sky.jpg); font-family: Verdana; font-size: 12pt; }

I've tried:

url("images/sky.jpg")
url('images/sky.jpg')
url(images/sky.jpg)
url(http://www.mydomain/images/sky.jpg)
etc. - same url with/without " and '

I can't for the life of me figure out how to get the background image to show.

I've programmed many CSS files before, and I tried it the same way I did before, but it still didn't work.

Any ideas?

Matt Probert

5:25 pm on Sep 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use an external style sheet and include the rule:

BODY { background: url("images/sky.jpg"); }

or you can use:

<body background="images/sky.jpg">

As far as I can tell, background-image is applicable to all other elements except <body>, and yes I know that is a ridiculous notion!

Matt

SuzyUK

7:32 am on Oct 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Stargazer - Welcome to WebmasterWorld!

your codes look fine, but I would use the ones without the quotes " or ', they're not required and cause some older browsers to choke, maybe not such a big deal these days, but still prefer it ;)

Are you aware that background images are called relative to the stylesheet itself and not necessarily in relation to the page. The absolute url should work (if you're online and the image is in a folder called images on your server) but other wise make sure the relative path is relative to the stylesheet.

Frontpage may do something different, but it shouldn't! Another way is to make sure that all images that are called from the CSS file actually reside in the same folder as the external CSS file, that way you don't have to remember to use a folder name at all in your css.. and it keeps everything to do with styling in the same place.

Don't know if that's any help..

Suzy

Stargazer

5:34 pm on Oct 1, 2004 (gmt 0)

10+ Year Member



You know, the problem ended up being with the HTML coding. Frontpage was "holding" the setting for the original background through the menu (Format/Background) and was keeping that code in the page html. When I removed the background code from that hmtl page, everything worked.

I've been having problems using FP. Maybe it's time I look at Dreamweaver...?