0

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.

mplungjan
  • 134,906
  • 25
  • 152
  • 209
Mayur Koshti
  • 1,582
  • 13
  • 20

1 Answers1

1

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.

Mark
  • 672
  • 6
  • 18