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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include files for root and subdirectories 1

Status
Not open for further replies.

codecomm

Programmer
Feb 14, 2007
121
US
I have a site which will have subdirectories.

I'm creating a template having .js and .css file includes?

How can I create a template that works in both the root and subdirectories w/o having to have two versions like the following where I have my .css file in a folder called css. First example is for a page in the root, second is for a file in a subdirectory under root.

href="css/stylesheet.css"

href="../css/stylesheet.css
 
Code:
href="[blue]/[/blue]css/stylesheet.css"
The beginning slash will tell the script to begin at the web document root. So no matter what subfolder this is called from, it will always begin from the root.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thanks Vragabond!

I knew it was something like that.

I kept using tilda "~" then a forward slash.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top