How to HREF the INDEX

157 Views Asked by At

So I want to make my logo the href back to the homepage which would be something like this C:\Users\Nathan Connor\Desktop\web but I was thinking, when I upload it to a hosting website it wont be able to find C:\Users\Nathan Connor\Desktop\web lol.. so how would I href it or would I have to change it all once uploaded onto a hosting site, because I cant buy a host at the moment to host it right now.

1

There are 1 best solutions below

0
On

Href has two paths:

1.Absolute Path

2.Relative Path

Your C:\Users\Nathan Connor\Desktop\web\index.html is Absolute Path.

You need "Relative Path".

If your hosting site root is "mysite" and your index.html in "mysite" like this:

mysite/
├── index.html
└── other
    └── about.html

Then your href is:

<a href="index.html">index</a> .

If your index.html in "mysite/index.html" and your have a about.html in "mysite/other/about.html" , you want refference index.html in "about.html" ,then your href will is (in about.html) :

<a href="../index.html">index</a> .

Thanks!