1

How do I create a link using HTML to scroll down to a certain a h1, just using HTML? Is it possible?

I have an idea from using Bootstrap studio but not sure if it’s actually the correct way of doing it. You link to the Id of the element you want to scroll to by creating an Id for header and then adding the if to the link tag.

<a href=“#h1”>Scroll Down to header</a>
<h1 id=“h1”> Header</h1>

Is this right? Or is it more to it then that?

I’m new at StackOverflow btw... I looked for this answer but couldn’t find anything.. must have been saying the wrong thing.

Malcolm
  • 61
  • 9

1 Answers1

0

Correct. As long as you include the # before the id you are referring to, the code will scroll down to the referenced element.

Reference to this question: Link to an element within the current page

Extra
If you want an animated scroll, check out this question: jQuery scroll to element