Most demos need a newer browser

They use :has() and container queries. Update your browser, or on an iPhone update iOS to 16.4 or later.

CSS Navigation Examples

Navigation is the part of a site people use without thinking about it, which is exactly why it repays being built carefully. Menus that open on hover, tabs that swap panels, breadcrumbs that show depth, and drawers that slide in on a phone all come from a small set of CSS features: :hover, :target, :focus-within, and the state a hidden checkbox or radio can hold.

The examples below cover those patterns and the ones that react to scrolling, such as headers that shrink and indicators that track which section you are reading. Each page explains what the pattern can and cannot do without script, including the cases where a keyboard user would be left behind.

No examples match these filters yet. Turn on another level or pick another category.

Scroll the colors under the glass

Your browser can't run this demo

It needs :has(), which this browser doesn't support yet. It works in Chrome 105+, Edge 105+, Firefox 121+ and Safari 15.4+.

Needs :has()

Home Forms Layout
Scroll
down
and
watch
it
blur

Frosted Navbar

Beginner

A sticky bar with backdrop-filter: blur() that frosts the page as it scrolls, plus a slide-in panel and a nested filter fix.

One main action, more behind the arrow

Your browser can't run this demo

It needs :has(), color-mix(), popover and anchor positioning, which this browser doesn't support yet. It works in Chrome 125+, Edge 125+, Firefox 147+ and Safari 27+.

Needs :has(), color-mix(), popover and anchor positioning

Split Button Menu

Intermediate

Two buttons, one group: the left triggers the primary action, the right opens a popover menu of alternatives with no JavaScript.

Scroll the list

A
AJ
Alice JohnsonDesign
AM
Alex MorrisEngineering
AW
Amy WuMarketing
B
BC
Ben CarterEngineering
BL
Beth LeeDesign
C
CK
Chris KimProduct
CM
Clara MillsDesign
CP
Cole ParkEngineering
D
DJ
Dana JonesMarketing
DS
Drew SmithEngineering
E
EB
Emma BrooksDesign
EH
Ethan HallProduct
F
FN
Fiona NashEngineering
FO
Frank OrtizMarketing

Sticky Section Headers

Beginner

Section headings that pin to the top of the scroll area as you scroll past them, contacts-list style, in pure CSS.

Scroll inside the frame

↓ scroll to shrink the header

Shrinking Sticky Header

Intermediate

A sticky header that shrinks its height and text on scroll using CSS scroll-driven animations, with no JavaScript.

Pick a section from the left

Overview

A quick introduction to the product. Use vertical tabs to organize content into logical sections without page reloads.

Features

Zero JavaScript, accessible via keyboard, fully themeable with CSS custom properties. Works on all modern browsers.

Pricing

Free and open source. Use it in personal and commercial projects. No attribution required.

Support

Open an issue on GitHub or check the documentation. Community-driven support available 24/7.

Vertical Tabs

Intermediate

Vertical tabbed navigation using radio inputs and the :checked pseudo-class.

Click a number, prev or next, or use arrow keys

Showing results 1-10 of 48 Showing results 11-20 of 48 Showing results 21-30 of 48 Showing results 31-40 of 48 Showing results 41-48 of 48

Pagination Component

Intermediate

Numbered page buttons with an active state driven by radio inputs and :checked.

Scroll the panel

Introduction

This sidebar uses position: sticky to stay in view while the content area scrolls. Scroll down to see it in action.

Installation

No dependencies required. Copy the CSS and HTML into your project. It works with any layout.

Usage

Add position: sticky; top: 0 to any element inside a scrolling container to pin it to the top.

API Reference

The sticky behavior respects top, bottom, left, and right offset values for precise positioning.

Examples

Common uses include sticky table headers, side navigation, notice banners, and floating action buttons.

Sticky Sidebar

Beginner

A sidebar that sticks to the viewport while scrolling using position: sticky.

Scroll the article

Reading Progress

Check the frame and tires

Start with a visual inspection of the frame. Look for cracks, rust spots, or paint chips that expose bare metal. Check the welds where tubes meet. Run your hand along each seam. Small surface rust can be sanded and touched up with paint. Deep corrosion or cracks mean a trip to a bike shop. Frame damage is not something you fix at home.

Move to the tires next. Spin each wheel and watch for wobbles or hops. A wheel that moves side to side needs truing. Check the tire sidewalls for dry rot, which shows up as small cracks in the rubber. Press your thumb into the tread to feel for soft spots or cuts. Inflate both tires to the pressure range printed on the sidewall. Under-inflated tires make pedaling harder and wear out faster.

While the wheels spin, listen for grinding or clicking. Those sounds usually mean the bearings need attention. A bearing service takes special tools, so most riders bring that work to a shop. Check that the quick-release levers close firmly, with the lever pointing back along the fork or frame. An open lever is an easy way to lose a wheel.

Clean and lubricate the drivetrain

Wipe down the chain with a rag. Shift through every gear to expose the full length. A chain that looks black or gritty needs degreaser. Spray or brush the degreaser on, let it sit for a minute, then scrub with an old toothbrush. Rinse with water and dry the chain completely.

Apply chain lube one drop at a time on the top run of the chain, turning the pedals backward to work it in. Wipe off the excess with a clean rag. Too much lube attracts dirt. The chain only needs oil between the rollers, not coating the outside. A properly lubed chain runs quietly and shifts smoothly.

Check the derailleur cables while you are at it. Frayed cables snap when you shift under load. Shift into the smallest cog on the back wheel and inspect where the cable enters the derailleur. Look for broken strands sticking out from the cable housing. Replace any cable with visible damage.

Test the brakes and adjust the seat

Squeeze each brake lever hard and hold it while you try to push the bike forward. The wheel should lock completely. Inspect the pads for grooves or uneven wear. Pads worn down to the indicator line need replacing before your first ride.

Finish with the saddle height. Stand next to the bike and raise the seat until the top is level with your hip bone. Sit on the bike and put your heel on the pedal at its lowest point. Your leg should be straight. A seat that is too low makes your knees hurt on long rides. Once the height feels right, tighten the seat post clamp and give the saddle a twist to confirm it will not move.

Scroll Spy Indicator

Advanced

A reading progress bar that tracks scroll position using CSS scroll-driven animations.

Click a tab to switch panels

Design panel content goes here.
Code panel content goes here.
Preview panel content goes here.

Tabs

Intermediate

Tabbed interface using radio inputs and the :checked pseudo-class.

Click the field to expand it

Expandable Search Bar

Beginner

A search bar that expands on focus with a smooth CSS transition.