0

Why do HTML links sometimes add ./ before HTML file destination, and sometimes not?

Example:

<a href="./contact.html">Contact Us</a> 
        //compared to
<a href="contact.html">Contact Us</a>

Coding language: HTML
Skill level: Beginner
Editor: Visual Studio Code
OS: Windows 7

  • imagine you are in "http://www.somwhere.com/someLink" if you use ./contact.html it refers to "http://www.somwhere.com/someLink/contact.html" but case using "contact.html" link will refer to "http://www.somwhere.com/contact.html" – X-_-FARZA_ D-_-X Apr 15 '22 at 19:48
  • @X-_-FARZA_D-_-X That is not the case, both links will stay in the "current directory", which would be `http://somwhere.com/`. – Progman Apr 15 '22 at 20:06

0 Answers0