How do you link to some place on the same page in HTML. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 14

How do you link to some place on the same page in HTML.

Question

3rd Oct 2018, 7:21 PM
Elijah D
Elijah D - avatar
9 Answers
+ 31
hello Elijah D. first, create a bookmark with the id attribute for example id="Chapter1" <h1 id="Chapter1">Chapter 1</h1> Then, add a link to the bookmark ("Jump to Chapter 1"), from within the same page: <a href="#Chapter1">Jump to Chapter 1</a> that is it!
3rd Oct 2018, 7:51 PM
asa22
+ 10
Thanks for your input.
4th Oct 2018, 12:01 AM
Elijah D
Elijah D - avatar
+ 8
Wow thats easy! Thank you.
3rd Oct 2018, 10:53 PM
Elijah D
Elijah D - avatar
+ 6
+asa22 that's not a bookmark but an anchor...
3rd Oct 2018, 10:00 PM
xXiamnerdyXx
xXiamnerdyXx - avatar
+ 4
relax, xXiamnerdyXx , w3schools calls it a bookmark. Internal link might be less misleading, but there are people out there who refer to this as such.
3rd Oct 2018, 11:46 PM
Janningā­
Janningā­ - avatar
+ 4
:) I actually know these as "fragment identifiers" They're often used just for in-page jumping but they can be a bit more useful (media, PDF control, etc): https://en.m.wikipedia.org/wiki/Fragment_identifier
4th Oct 2018, 5:26 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
<div id="top"></div> ... ... ... <a href="#top">top<a> This is how I understood the question to best answer it.
5th Oct 2018, 3:11 PM
Ricardo
0
wow am i can use that in all the pages
5th Oct 2018, 7:02 AM
AHMED HASSAN MOHAMED
AHMED HASSAN MOHAMED - avatar
- 4
08778/^&7
4th Oct 2018, 11:17 AM
Khair Mohammad Eskandri
Khair Mohammad Eskandri - avatar