silent_circus Posted September 11, 2009 Share Posted September 11, 2009 I have a web site project for school and I can not remember if you can reference a a file in a previous folder that contains the main external .css and .js files for the site. I do not know if I explained it clearly but I will use an example:My main pages are all located on the main server home.htm, etc. then I created a folder that held other pages, lets call it subfolder, so the address to any pages under there would be http://....../subfolder/page.htm.If I want to reference the external files from the main folder on the pages in the subfolder how do I do that? I guess what I mean is how do I back-reference (don't know if that is the term) a styles of Javascript file to a page in a subfolder, when these files are located in the main folder. Instead of having a different copy of the .css file in the subfolder as well as the main folder (which I find inconceivable even think of having to deal with).I apologize if this is confusing. Thanks in advance. Link to comment Share on other sites More sharing options...
ravenshade Posted September 12, 2009 Share Posted September 12, 2009 Well some tend to reference absolutely... but if you're going to keep the exact structure then there's no need. href="../CSS/main.css" each ../ represents one folder so ../../ is two folders up. (this works for me) Link to comment Share on other sites More sharing options...
Synook Posted September 12, 2009 Share Posted September 12, 2009 You can also use / to reference the document root of the site. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.