Hey, Bramus! I don't think you can use "scroll-behavior: smooth" for something like this.
Here I created a pen for you codepen.io/holdmypotion/pen/poNZzzo
I would love to know if there is a way. Do let me know :)
To scroll to a point in a page you need a link target. You can use <a name="foo" ></a> for this, or give your element an id <div id="foo"></div>. When now linking to #foo the page will scroll to said element.
Combined with scroll-behavior: smooth;, it will be scrolled smoothly.
ha ha ha, you know nothing about html {
scroll-behavior: smooth;
}. But pretend as if you know everything. Visit the page author recommended you then compare with scroll-behavior. This is not the same thing. If you think it's possible as you calimed show us a demo. Before commenting on any topic understand the topic clearly.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, Bramus! I don't think you can use "scroll-behavior: smooth" for something like this.
Here I created a pen for you
codepen.io/holdmypotion/pen/poNZzzo
I would love to know if there is a way. Do let me know :)
To scroll to a point in a page you need a link target. You can use
<a name="foo" ></a>
for this, or give your element an id<div id="foo"></div>
. When now linking to#foo
the page will scroll to said element.Combined with
scroll-behavior: smooth;
, it will be scrolled smoothly.Yea, I am quite aware of this use case. But can this be used to implement an overall smooth scrolling effect?
Like this: lic4s.csb.app/
Yes, because the browser provides that out-of-the-box 🥳
ha ha ha, you know nothing about html {
scroll-behavior: smooth;
}. But pretend as if you know everything. Visit the page author recommended you then compare with scroll-behavior. This is not the same thing. If you think it's possible as you calimed show us a demo. Before commenting on any topic understand the topic clearly.