Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
scroll-behavior

7 Articles
{
,

}
Direct link to the article “Cancelable” Smooth Scrolling
scroll-behavior scrolling

“Cancelable” Smooth Scrolling

Here’s the situation: Your site offers a “scroll back to top” button, and you’ve implemented smooth scrolling. As the page scrolls back to the top, users see something that catches their eye and they want to stop the scrolling, so …

Chris Coyier on Feb 1, 2021
Direct link to the article How to Make an Unobtrusive Scroll-to-Top Button
buttons scroll-behavior scrolling

How to Make an Unobtrusive Scroll-to-Top Button

A button to return to the top of the page allows the user to quickly return to the top of the page without making too much effort. This can be very useful when the page has a lot of content …

Marcel Rojas on Oct 5, 2020
Direct link to the article CSS-Only Carousel
carousel scroll-behavior scroll-snap slider slideshow

CSS-Only Carousel

Editor’s Note: Chrome is prototyping a new feature for creating carousels directly in CSS, including scroll buttons and scroll markers for navigating between slides. Get all the information in this newer article.

It’s kind of amazing how far HTML …

Chris Coyier on Apr 17, 2025
Direct link to the article Downsides of Smooth Scrolling
scroll-behavior scrolling scrollIntoView smooth scrolling

Downsides of Smooth Scrolling

Smooth scrolling has gotten a lot easier. If you want it all the time on your page, and you are happy letting the browser deal with the duration for you, it’s a single line of CSS:

html {
  scroll-behavior: smooth;
…
Chris Coyier on Mar 11, 2019
Direct link to the article Scroll to the Future
scroll-behavior scroll-snap scrollbars

Scroll to the Future

This is an interesting read on the current state of scrollbars and how to control their behavior across operating systems and browsers. The post also highlights a bunch of stuff I didn’t know about, like Element.scrollIntoView() and the scroll-behavior CSS …

Robin Rendle on Aug 7, 2018
Direct link to the article scroll-behavior
scroll-behavior scrolling smooth scrolling

scroll-behavior

The scroll-behavior property in CSS allows us to define whether the scroll location of the browser jumps to a new location or smoothly animates the transition when a user clicks a link that targets an anchored position within a scrolling …

Geoff Graham on Jan 30, 2020
Direct link to the article Smooth Scrolling
jQuery scroll-behavior scrolling smooth scrolling

Smooth Scrolling

Hey! Before you go too far down the rabbit hole of JavaScript-based smooth scrolling, know that there is a native CSS feature for this: scroll-behavior.

html {
  scroll-behavior: smooth;
}

And before you reach for a library like jQuery …

Chris Coyier on Sep 28, 2022

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top