Date:  07/10/2006 02:53:38 AM Msg ID:  003037
From:  James Williams Thread:  003033
Subject:  Re: How to use CSS?
If your stylesheet and image are in the same folder try removing the "/" from url(/background.gif) and href="/background.css" this should resolve it. The "/" states that the files are in the root folder.
Sent by Larry Zhang on 07/07/2006 07:24:56 AM:
But the background image is still not displayed even if I put the image file under the Web root directory and code it like
 
html, body {
 width: 100%;
 margin: 0px;
     background-image: url(/background.gif)
}
 
link it like this
 

<head>

<link rel="stylesheet" type="text/css" href="/background.css" />

</head>

 
Anybody could test if for me? Thanks a lot.
 
Sent by Larry Zhang on 07/07/2006 07:18:28 AM:
I got the answer from your previous subjests --
 
Just like images, stylesheets, if linked to the document via the <LINK> tag must be stored in the Web tree and referred to using absolute paths (starting with a slash character).  If for example you copy the file mystyle.css in the stylesheets subdirectory of your Web root, you can refer to it with:
<LINK rel="stylesheet" type="text/css" href="/stylesheets/mystyle.css">
 
If the file is simply copied to your Web root directory then all you need is a leading slash before the file name:
<LINK rel="stylesheet" type="text/css" href="/mystyle.css">
 
Sent by Larry Zhang on 07/07/2006 06:52:48 AM:
I created a simple CSS file. and save it as "background.css" under the same folder of my application.
 

hr {color: sienna}
p {margin-left: 260px}

body {background-image: url("images/background.gif")}

 
But I'm unable to use it when my web file has the extension of .fwx.
It works well when you link it using .html file format.
 

<head>

<link rel="stylesheet" type="text/css" href="background.css" />

</head>

 

Regards.