Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CSS & background images

0 views
Skip to first unread message

Mark Rae

unread,
Jul 11, 2006, 10:18:59 AM7/11/06
to
Hi,

Apologies for what I'm sure is a very stupid mistake I'm making, but can
anyone please tell me why the following correctly displays the background
image:

<head>
</head>
<body style="background-position: center bottom; background-attachment:
fixed; background-image: url(../images/skylinelogo.gif); background-repeat:
no-repeat">

but the following doesn't:

<head>
<link href="../includes/css/default.css" type="text/css"
rel="stylesheet" />
</head>
<body>

</body>

The contents of default.css is as follows:

body
{
margin-top: 0px;
font-family: Verdana;
font-size: smaller;
color: Blue;
background-image: url(../images/skylinelogo.gif);
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center bottom;
}

The relative path to the stylesheet is definitely correct, because I can
change the color: Blue element to something else and the difference appears
correctly.

Any assistance gratefully received.

Mark


PTM

unread,
Jul 21, 2006, 7:42:20 PM7/21/06
to
"Mark Rae" <ma...@markNOSPAMrae.com> wrote in message
news:uDEB2TP...@TK2MSFTNGP05.phx.gbl...

From your code, your folder structure appears to be as follows:
____________________
| | |
pages images includes
| | |
page.html skyline.gif css
|
default.css

Your html body code works because you are moving out of the pages folder and
into the images folder to pick up your gif file.

However your css is trying to use the folder structure:
____________________
| | |
pages images includes------------
| | | |
page.html skyline.gif css images**
| |
default.css skyline.gif*

and trying to find the gif file * in the images** folder

Try changing the css line:
background-image: url(../images/skylinelogo.gif);

to
background-image: url(../../images/skylinelogo.gif);

or use an absolute path rather than a relative one (eg:
www.mysite.com/images/skyline.gif)

hope that helps

Phil


0 new messages