Spencer T Spencer T - 1 year ago 67
CSS Question

How do I link back out of a folder using the a-href tag?

Alright so I have a page in a folder, the page is called jobs.html and the folder is simply called "jobs". Its a sub folder of my mine "website" folder. In the main directory of the "main" folder is my "home.html" file. When I try to do

<a href="home.html">bla</a>

It malfunctions as it is looking for the home file in the jobs folder, which does not exist.

So I ask, how can I reference out of a folder to call a file from the root folder?

Answer Source

Try setting your link to be your site root as so; note the / in front of home.html:

<a href="/home.html">bla</a>

Or if you know the path is definitely one directory down then just explicitly tell it to go down 1 directory; note the ../ in front of the home.html.

<a href="../home.html">bla</a>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download