I have few div
s .posts
which have a attr data-id
which corresponds to the mysql DB id
.
I'm seeing a lot of jQuery and Javascript in here, and simple CSS is here to help!
html,body {
scroll-behavior: smooth;
}
To put this in action, use a link and give it an href with the id of the element you're scrolling to:
Section One
Section One
Not all browsers however support the scroll-behavior
property, in which case I'd recommend the selected answer near the top ;)