How to create a link to a internal section (like contact us) from another (like nav bar)....Using anchor tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to create a link to a internal section (like contact us) from another (like nav bar)....Using anchor tag

I need help in inline linking... I know a method (from a website on internet) Where you has to create an <a> to that point where u want to go (like contact me section) and then give it an id and then a <a> in nav bar and in its href attr. Put that id with a # (like : #id) ... But in this method whenever i click on the link in nav bar it work and navigate me to contact but when i press back key it doesn't go back to previous page. It brings me back to nav bar, means it works as an external link (like a link to a external webpage).... But yrz ago i came acrosz a method where we uses names instead of id and in href, we uses "_name" but i dont know how to use it I hope u guys understand my needs So plzzzz help me And sorry for my spelling mistakes....

2nd Aug 2020, 1:43 PM
Abhay
Abhay - avatar
7 Answers
+ 2
Divya Mohan Jayakrishna🇮🇳 Man it works but on pressing back button, it navigate me back to top instead of previous page But I want it navigate me to previous page, not to top ....
2nd Aug 2020, 2:25 PM
Abhay
Abhay - avatar
+ 1
Give a's href value as internal section id I hope it works.
2nd Aug 2020, 1:48 PM
Jayakrishna 🇮🇳
+ 1
Use there id ex in nav bar you want a contact link <nav> <a href="#name">contact</a> </nav> And set the id of container tag of contact section name <div id="name"> .......contact stuff </div> Try it .
2nd Aug 2020, 1:59 PM
Divya Mohan
Divya Mohan - avatar
+ 1
Could you please link your project herw
2nd Aug 2020, 2:28 PM
Divya Mohan
Divya Mohan - avatar
+ 1
Try to go on abhay01.epizy.com
4th Aug 2020, 6:22 AM
Abhay
Abhay - avatar
+ 1
Nice work , I seen there !!!👍 But soory I don't know how mobile button works . Ya but I only can suggest you to add a button in the page with previous page link to go to previous page . Otherwise wise visiter can go to previous page when they click second time
4th Aug 2020, 6:38 AM
Divya Mohan
Divya Mohan - avatar
+ 1
Or I think you can manipulate it if you know the event name of (previous button pressed ) By default it has been set to go back one step back onclick If you can access you can manipulate it to go two step back
4th Aug 2020, 6:41 AM
Divya Mohan
Divya Mohan - avatar