Issue
This is the current code for my navigation bar:
<nav>
<a href="example.com"> Fact Generator</a>
<a href="example.com/privacy">Privacy</a>
<a href="#">Contact</a>
</nav>
This is my website: https://example.com/
When I go to my website and click privacy, it takes me to https://example.com/example.com/privacy
Any help so it instead takes me to https://example.com/privacy
?
Solution
you can use an absolute path or specify a root-relative path for the "Privacy" link.
Here's the corrected code:
<nav>
<a href="https://example.com">Fact Generator</a>
<a href="https://example.com/privacy">Privacy</a>
<a href="#">Contact</a>
</nav>
Or, if you want to use a root-relative path:
<nav>
<a href="/">Fact Generator</a>
<a href="/privacy">Privacy</a>
<a href="#">Contact</a>
</nav>
This way, when you click on the "Privacy" link, it will take you to the correct URL: https://example.com/privacy
.
Answered By - Vida Khalili
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.