I could do a scroll to this div. How can I make the sa...">

HTML5 Section Link

Ok, in HTML 4.01, for example, <div id="example">I could do a <a href="#example">scroll to this div.

How can I make the same effect using <section class="asd xyz">?

+5
source share
1 answer

They work the same way. Add the id to the section and the link should work.

<section id="example"></section>

This code goes into the section #example.

<a href="#example">Jump to example</a>

EDIT: Pure HTML does not allow you to jump to class names for a good reason. Identifiers are unique, and classes can be reused as often as you want. Therefore, you simply cannot move on to the class name, since it probably has no purpose.

+15
source

All Articles