0Pricing
CSS Academy · Lesson

Sticky Footer and Sidebar Layout

Build layouts with sticky footers and sidebars that stretch full height using Grid or Flexbox.

Sticky Footer Problem

A sticky footer stays at the bottom of the viewport when content is short, but pushes down with content when content is long. The historical challenge: making the footer stick without knowing content height or using JavaScript.

Flexbox Sticky Footer

The simplest modern solution: body { display: flex; flex-direction: column; min-height: 100vh; } and main { flex: 1; }. The main content grows to fill available space, pushing the footer to the bottom regardless of content length.

All lessons in this course

  1. Sticky Footer and Sidebar Layout
  2. Holy Grail Layout with Grid
  3. Masonry Layout: CSS and JS Approaches
  4. Intrinsic Design: Content-Driven Sizing
← Back to CSS Academy