Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic HREF question! 1

Status
Not open for further replies.

halfpizzasupper

Programmer
Dec 3, 2008
1
I have a quick question regarding using HREF and site structure.

I believe that if I have a page which is up one folder from say my stylesheet that I have to include "../" before referencing this but I have saw some sites that do not follow this rule. Can this be set in a config file or something?

i.e.
Say I have the following two folders
[CSS]
[Shop]
Within [Shop] there is my default html page and I need to make a reference to my stylesheet so I use
Code:
<link rel="stylesheet" type="text/css" href="../css/core.css" media="screen,projection" />
I was then looking at another site with a similar set up and they simply had
Code:
<link rel="stylesheet" type="text/css" href="/css/core.css" media="screen,projection" />
which seemed to work just fine also but I am always having to put the "../".

Not that this is a huge issue, I'm just curious so I can learn! Is it something to do with the file system on the server (i.e. Windows, linux?)
 
It's not a configuration thing, "../" and "/" are two different things.

The former, as you know, takes the path from the current location - in this case "up" one level etc.

The latter refers to the site root. You could take the same path reference, put it elsewhere in the site and it would still point to the same place.

Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top