Well, in HTML 4.01 with for example <div id="example">
I could make <a href="#example">
to scroll to that div.
How can I make the same effect with <section class="asd xyz">
?
It'll show you HTML code, look for an ID tag or Value option. Once you find it, copy it on your clipboard. Next, take the URL of the web page and append the #ID at the end of it. And that's it when someone clicks that link, it will take them directly to that specific part of the webpage.
They work the same. Add an ID to the section and the link should work.
<section id="example"></section>
This code jumps to the section #example
.
<a href="#example">Jump to example</a>
EDIT: Pure HTML does not allow you to jump to class names and for a good reason. IDs are unique while classes can be reused as often as you want. Therefore you just can't jump to a class name since it probably doesn't have a single target.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With