Ask coding questions

← Back to all posts
How do i do internal anchor link ?
Anonymous847 (9)

Hello I'm trying to learn HTML and I'm a bit confused with internal anchor link, it would be great if someone helped me with this

Answered by ch1ck3n (2077) [earned 5 cycles]
View Answer
Comments
hotnewtop
ch1ck3n (2077)

ok let's say you have a heading with an id of bababooey.
<h1 id="bababooey">I'm a heading</h1>
and you wanted a link on the bottom of the page to jump to that h1.
then you would do this:
<a href="#bababooey">jump the the heading</a> notice it has a # before the bababooey. that means it tells the page to jump the element with that id, not mysite.com/#bababooey.

edit: it does actually go to /#bababooey but you know what I mean

ch1ck3n (2077)

@ch1ck3n https://replit.com/@ch1ck3n/internal-links here is a repl demonstrating this one heckuva feature in html

Anonymous847 (9)

@ch1ck3n Great! Thanks for your Help!

ch1ck3n (2077)

@Anonymous847 np

(this is probably the best question ever asked on replit i saw, and its not on stack overflow)