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

Articles Tagged
sticky

23 Articles
{
,

}
Direct link to the article How to Make a “Raise the Curtains” Effect in CSS
mix-blend-mode scrolling sticky

How to Make a “Raise the Curtains” Effect in CSS

“Raise the curtains” is what I call an effect where the background goes from dark to light on scroll, and the content on top also goes from light to dark while in a sticky position.…

Silvestar Bistrović on Mar 2, 2022
Direct link to the article Using Position Sticky With CSS Grid
grid sticky

Using Position Sticky With CSS Grid

Say you’ve got a two-column CSS grid and you want one of those columns to behave like position: sticky;. There is nothing stopping you from doing that. But the default height for those two columns is going to be …

Chris Coyier on Dec 10, 2021
Direct link to the article A Clever Sticky Footer Technique
sticky sticky footer

A Clever Sticky Footer Technique

Upon hearing “sticky footer” these days, I would think most people imagine a position: sticky situation where a footer element appears fixed on the screen while in the scrolling context of some parent element.

That’s not quite what I’m talking …

Chris Coyier on Nov 16, 2021 Updated on Nov 17, 2021
Direct link to the article Sticky Headers: 5 Ways to Make Them Better
sticky

Sticky Headers: 5 Ways to Make Them Better

Page Laubheimer says that if you’re going to do a sticky header…

  1. Keep it small.
  2. Visually contrast it with the rest of the page.
  3. If it’s going to move, keep it minimal. (I’d say, respect prefers-reduced-motion.)
  4. Consider “partially persistent
…
Chris Coyier on Apr 21, 2021
Direct link to the article Creating a Smart Navbar With Vanilla JavaScript
navigation sticky

Creating a Smart Navbar With Vanilla JavaScript

Sticky, or fixed, navigation is a popular design choice because it gives users persistent access to navigate the site. On the other hand, it takes up space on the page and sometimes covers content is a way that’s less than …

Jemima Abu on Apr 5, 2021
Direct link to the article #205: Sticky Positioning: How it Works, What Can Break It, and Dumb Tricks
sticky

#205: Sticky Positioning: How it Works, What Can Break It, and Dumb Tricks

How it works

You apply position: sticky; to an element along with a top, left, right, or bottom threshold and it will “stick” in that position when the threshold is passed, as long as there is room …

Chris Coyier on Mar 15, 2021 Updated on Jul 9, 2021
Direct link to the article How to Create a Shrinking Header on Scroll Without JavaScript
navigation scrolling sticky

How to Create a Shrinking Header on Scroll Without JavaScript

Imagine a header of a website that is nice and thick, with plenty of padding on top and bottom of the content. As you scroll down, it shrinks up on itself, reducing some of that padding, making more screen real …

Håvard Brynjulfsen on Feb 16, 2021 Updated on Jun 7, 2021
Direct link to the article A table with both a sticky header and a sticky first column
sticky tables

A table with both a sticky header and a sticky first column

We’ve covered that individual <table> cells, <th> and <td> can be position: sticky. It’s pretty easy to make the header of a table stick to the top of the screen while scrolling through a bunch or rows (like this …

Chris Coyier on Feb 9, 2021
Direct link to the article How to Get Sticky and Full-Bleed Elements to Play Well Together
grid sticky

How to Get Sticky and Full-Bleed Elements to Play Well Together

I had a unique requirement the other day: to build a layout with full-bleed elements while one element stays stuck to the top. This ended up being rather tricky to pull off so I’m documenting it here in case anyone …

Silvestar Bistrović on Dec 4, 2020 Updated on Jan 14, 2021
  • 1
  • 2
  • 3
  • Older

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