You probably want position: sticky instead of fixed

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateWeb DesignUI16 min

About this video

A CSS tutorial comparing position fixed and position sticky, covering where sticky suits headers and navbars, how sticking to the bottom behaves, and a common mistake that stops sticky from working. It suits developers and designers who already know basic CSS positioning.

What you’ll learn

  • Choose position sticky over fixed for headers and navbars
  • Predict how sticky behaves when sticking to the bottom of a container
  • Avoid the common mistake that stops position sticky from working