Ask any question about CSS here... and get an instant response.
Post this Question & Answer:
How can I create a smooth scrolling effect using only CSS?
Asked on Feb 23, 2026
Answer
To create a smooth scrolling effect using only CSS, you can utilize the `scroll-behavior` property. This property allows you to define how the scrolling should behave, making it smooth without any JavaScript.
<!-- BEGIN COPY / PASTE -->
html {
scroll-behavior: smooth;
}
<!-- END COPY / PASTE -->Additional Comment:
- The `scroll-behavior` property can be applied to the `html` element to affect the entire page.
- Setting it to "smooth" enables smooth scrolling for all anchor link navigation.
- This property is supported in most modern browsers, but not in Internet Explorer.
- Ensure your links have hrefs pointing to IDs on the page for the scrolling to work.
Recommended Links:
