D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] css file in site root called from a subdirectory

 

On Sat, 14 Jan 2006 21:33:41 +0000
Paul Sutton <zen14920@xxxxxxxxx> wrote:

> Hi
> 
> if have a file called index.html and I want to call style.css, I just 
> use style.css
> what happens if the file is  /firstxv/first.html
> 
> how do I call the css file,  as I need to reference it as being in the 
> site root.
> 
> I was thinking of something like ../style.css
> 
> I am using matts template to see if I can make the prfc site any better, 
> I want to keep all files for each section separate, so I am calling each 
> html page from index by doing ./directory/file.html
> 
> I set up the first few then realised that doing this won't load the css 
> file.  I need to reference back a level,  it took a while to figure out 
> how to reference a directory up
> 
> thanks in advanced for any help.
> 
> Paul

If the css file is in the "root" of your www directory, then you can call it with 
"/style.css" from any subdirectory no matter how deep.  Personally I would avoid 
using relative links like "../somewhere" and use absolute paths *from* your root, 
like "/directory/subdir/file.ext".

Grant.

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html