Mayur Koshti
Mayur Koshti

Reputation: 1852

How to access about us html file from the default index html file in localhost?

Only HTML Files (in same folder):

I have 2 files index.html and aboutus.html. I am running mysite without any file it opens index.html (by default which I know) but when I click on "About Us" (aboutus.html) it does not open aboutus.html. Nothing happening!

I have written the following code in index.html

<div class="navbar" id="navbar">
  <a href="#">HOME</a>
  <a href="aboutus.html">ABOUT US</a>
</div>

I am using localhost to test the files. I am newbie and I have no idea where I am wrong.

Upvotes: 0

Views: 627

Answers (1)

Mark
Mark

Reputation: 740

Your ./index.html and ./aboutus.html files should be in the SAME directory.

Also make sure you do not have any <base> tags inside the <head></head> tags of your document as this will force the browser to look for the aboutus file in a different directory.

There is absolutely nothing wrong with your HTML tags so other than the above, it should work.

Please check to see if the URL changed - perhaps the content of index.html and aboutus.html is the same, and as such you didn't notice a difference?

Alternatively you should use F12 to launch the developer console to see if any errors are generated.

Upvotes: 1

Related Questions