I tried doing that by creating a tag at the desired section and then linking to that section using an anchor link but it doesn't work when i add a base url in the head element of the html document. can someone explain me why it doesn't work on adding a base tag in the head element of the html document and is there any way i can have a base tag and still redirect to the desired section of the web page.
Asked
Active
Viewed 1,673 times
2 Answers
0
You use anchor tag with href to the id to element as shown below.
<div id="sectionYouWantToLink">
<!-- Various Section Childs -->
</div>
<a href="#sectionYouWantToLink">Go To Section</a>
Now when you click the a tag > Go To Section, it will take you the specific section.

Ashutosh Kumar
- 830
- 7
- 19
-1
Give an ID to your section and then use anchor tag and in it's hierarchical reference attribute write the id of the section to which you wish to refer. e.g.
<a class="nav-link" href="#footer">Contact</a>

xafak
- 21
- 1
- 1
- 7