CSS Examples Library
82 examples · all runnable online, source viewable, free to download
Application-level CSS examples — more than syntax demos: complete, ready-to-use pieces with polished UI and combined fundamentals. Preview live, copy the source, or download every example. Pair it with the CSS tutorial and reference manual for systematic learning.
Category:
Gradient Glow ButtonThree pure-CSS gradient buttons: linear-gradient fills, a glowing box-shadow that lifts on hover, and a ::before shine band sweeping across. Zero JavaScript — gradients, shadows and transitions working together.
3D Press ButtonA solid box-shadow acts as the button's side; on :active the button translates down onto its own shadow for instant 3D feel. Includes :focus-visible styling — a classic no-JS interaction pattern.
Hover Reveal CardA profile card: circular avatar over a gradient banner; on hover the card lifts and a hidden stats panel fades in. Animated with opacity + transform, keyboard-friendly via :focus-within, written in logical properties so it is RTL-safe.
Pure CSS LoadersFour classic loading indicators on one page: spinning ring, bouncing dots, indeterminate bar and breathing pulse — all driven by @keyframes alone, no JavaScript and no images. A must-study for animation timing and staggered delays.
Pill Hover NavbarA dark navbar: Flexbox menu with a pill highlight on hover and a ::after underline sliding out from the center via scaleX; aria-current marks the active page. A hands-on piece for flex layout plus pseudo-element animation.
Outline Slide ButtonTransparent outline buttons whose theme color slides up from the bottom on hover while the text flips to white — a one-line background-size 0%→100% fill with a strong sense of direction.
Neon Glow ButtonThree neon buttons on a dark stage: transparent fill, bright outlines, and twin text/box-shadow glows breathing on offset @keyframes delays. The signature example for layering shadows into a neon-tube look.
3D Flip Cardperspective sets the 3D depth, rotateY(180deg) flips the card, and backface-visibility: hidden keeps both faces in place — the three-piece combo behind every glitch-free flip card, and the essential intro to 3D transforms.
Glassmorphism CardColorful gradient blobs set the stage while the card gets frosted with backdrop-filter: blur — translucent fill, thin bright border and a soft large shadow. The core recipe of the glassmorphism trend on one page.
Pure CSS Hamburger MenuA hidden checkbox plus a label-drawn hamburger: click to slide the drawer in and reveal the overlay, click again to close — the classic checkbox hack that decodes most zero-dependency menus on the web.
Hover-Expand SidebarThe classic dashboard rail: icons only until hover expands it from 64px to 220px with labels fading in and the active item highlighted — a small finished piece for practicing transition with fixed positioning.
Skeleton ScreenGray placeholders before content arrives: avatar ring, text lines and an image block in position while a linear-gradient highlight sweeps across. The modern app's trick for perceived speed, shown next to a loaded card.
conic-gradient Progress RingA conic-gradient paints an angle-filled ring; cap it with an inner circle and it becomes a progress bar. Rotation plus a pulsing percentage in the center — no SVG, no canvas, one gradient.
Floating Label InputsThe label starts living inside the input, then shrinks, floats up and turns theme-colored on :focus or once :placeholder-shown no longer matches — Material Design's signature interaction and the classic pure-CSS way to detect user input.
Pure CSS Toggle SwitchStrip the checkbox with appearance: none and redraw it entirely: a pill track with a round knob that changes track color and slides across on :checked. A settings-page staple and the best exercise for the appearance property.
Split-Screen Login PageA full-page flex split: gradient brand panel with a slogan on one side, clean form panel on the other, and the brand column auto-hides on narrow screens. The most-used login layout in real products — a complete flex two-column, responsive exercise.
Glass Login CardA deep violet-blue gradient with floating blobs sets the mood while the login card frosts over: translucent inputs, bright borders and a glowing button. A complete mini-page applying glassmorphism to a real scenario.
Gradient TextThe three-piece combo that paints text with a gradient: background gradient + background-clip: text + color: transparent. Two differently styled headline blocks side by side — the finishing touch for hero typography.
Typewriter EffectA command types itself out in a terminal window: width driven by steps(), clipped by overflow: hidden, with a blinking ::after cursor. The most classic real-world use of the steps() easing function — essential for developer-style pages.
Glitch 404 PageA giant 404 with cyan/magenta ghosts: ::before and ::after each carry clip-path bands shaken by steps() into a broken-signal feel. A clip-path × steps() showpiece — the kind of 404 visitors remember.
Night-Sky 404 SceneA full-page night-sky gradient: a pure-CSS moon with halo, stars blinking on offset delays, and two mountain silhouettes grounding the scene around a 404 message — scene illustration with zero images, exercising gradients, positioning and animation together.
Status Dot BadgePresence for contact lists and support panels: a three-state dot pinned to the avatar corner (online/away/offline), with the online dot breathing a box-shadow halo — a tiny component with outsized presence, and great shadow/animation practice.
Notification BadgeRed count badges pinned to bell, message and cart icons: absolutely positioned over the corner, popping in with a scale bounce, capped at 99+. The everyday absolute+transform pattern and a starting point for recreating app UI.
Three-Column PricingThe SaaS-website staple: three cards in a row with the recommended one highlighted — accent border, 10px lift, stronger shadow and a top badge — reflowing to a column on narrow screens. The standard answer for flex card alignment, emphasis states and responsiveness.
Compact Pricing CardA single horizontal card in three sections: plan name and price on the left, two columns of features in the middle, a call-to-action on the right, one footnote below — compact pricing for tight spaces (modals, sidebars) and a neat flex three-section template.
Icon Slide ButtonOn hover the arrow slides into the button while padding makes room in one smooth motion — transition driving both padding and icon shift, the most restrained way to make a button move.
Social Login ButtonsFour full-width social buttons — GitHub, Google, Facebook and X: instantly recognizable brand colors with a subtle hover deepen. The staple of every login page, and a lesson in organizing brand-color variables.
Button Loading StatePress the button and the label yields to a spinning loader — a pure-CSS loading state on :active. Real submit flows need JS, but this example nails the half that CSS owns: state switching without layout jumps.
Testimonial CardOversized quote mark, testimonial text, a five-star rating and an avatar signature — the trust component of every landing page, and a clear lesson in typographic hierarchy.
Article Preview CardThe standard blog card: gradient cover, category badge, title, excerpt and a date/read-time row; on hover the card lifts while the cover zooms slightly inside overflow: hidden — the classic overflow × transform pairing.
Team Member GridFour member cards in a two-column grid, each revealing a social row on hover — grid layout plus independent per-card hover choreography, a ready-made skeleton for About pages.
Breadcrumb NavigationHome / Category / Subcategory / Current page — the hierarchy at a glance, current page bold and non-clickable. A small, correct, SEO-friendly component where aria-labels and separator semantics are the fine points.
Pagination Nav‹ 1 2 3 … 8 ›: current page as a solid pill, disabled arrows grayed out, ellipsis bridging the gap — the must-have pager that covers clickable, active and disabled states in one example.
Multi-Column FooterA complete footer — brand column, three link columns and a copyright row: grid for the layout, tasteful link typography and hover brightening. The facade component every serious site needs, and the one whose structure is most worth copying.
Chat Typing DotsThree dots bouncing in turn inside a chat bubble — the universal 'typing…' signal. One keyframe plus staggered delays makes the wave, with a real message bubble for context.
Equalizer LoaderFive bars dancing like sound waves: scaleY with transform-origin decides where each bar grows from, staggered delays draw the wave. The signature motion of audio players — and a hands-on scaleY-vs-translate comparison.
Success Check AnimationThe moment a submit succeeds: the disc pops in and an inline-SVG check draws itself via stroke-dashoffset falling to zero. stroke-dasharray/dashoffset is the most underrated combo in CSS animation — master it and every 'line grows' effect is yours.
Search Bar FormA large rounded search input: the border lights up and the shadow spreads on focus, with a kbd-styled Ctrl K hint on the side — the standard input of docs sites and dashboards, all about focus-state layering.
OTP Code InputsThe six-box OTP input for SMS/email codes: uniform squares with focused-cell highlight and inputmode=numeric to summon the number pad. Pure CSS owns the looks and focus states — the auto-advance JS boundary is called out explicitly.
Inline Form Validation:valid/:invalid paired with :placeholder-shown gives 'stay quiet until typed, speak up when wrong': a green ✓ floats in for a legal email, a red ✗ plus border for an illegal one — a validation state machine in pure CSS.
Centered Minimal LoginA small centered card on a white page: logo, welcome line, two fields, one button, one forgot-password link — minimalism pushed to its best, where spacing rhythm matters more than any decoration.
Social Login PanelEmail login first, an 'or' divider, three social buttons below — the standard modern login layout, with a divider trick worth remembering: flex plus borders that stretch to fill.
Dark Elegant LoginA near-black gradient with a faint halo, a glass card, and inputs whose border glows only on focus — dark-theme restraint where the glow is reserved for exactly one thing.
Outlined Display Text-webkit-text-stroke hollows the type into an outline that fills with color on hover — the poster-style headline trick and one of the most broadly useful text treatments around.
Neon Sign TextFour stacked text-shadows turn type into a neon tube: white core, colored halo, ambient glow, with a @keyframes flicker for that old-tube stutter — the atmosphere king of text effects.
Seamless MarqueeDuplicate the content end to end and translateX from 0 to -50% on loop — that's a seamless marquee; hover pauses it with one line of animation-play-state. The standard notice-bar pattern where the loop seam is the real trick.
Terminal 404 PageA 404 wrapped in a terminal window: traffic-light title bar, black-on-green error lines, a blinking cursor on the last row — the developer-aesthetic Easter egg page, full of monospace typography details.
Geometric Minimal 404Three pure-CSS shapes — circle, triangle, square — plus an outlined 404, one line of copy and a button. The un-flashy 404 that quietly tests your whitespace and alignment fundamentals.
404 Help & SearchDon't just apologize — build a bridge: the 404 line, a centered search box and three popular-page pills turn a lost visitor into a helped one. The search input reuses the focus treatment from our Search Bar example.
Removable ChipsFilter/tag chips: text plus an × that turns red-on-white on hover while the chip border deepens — a tiny component hiding an accessibility detail about generous hover target areas.
Gold Silver Bronze BadgesTop-three leaderboard badges: metallic gradient borders, medal emoji, and the runner-up card slightly enlarged in the middle — gamified ranking visuals where gradient angle decides the metal feel.
Live Stream BadgeThe LIVE pill on a stream card: blinking red dot, viewer-count badge, gradient cover. How a status badge comes alive — blink slowly enough to soothe, not so fast it alarms.
Monthly/Yearly Pricing ToggleA top slider flips monthly/yearly: :checked cross-fades two price sets and pops the 'save 20%' badge — the checkbox hack graduated from menus to business logic, the classic conversion switch on pricing pages.
Feature Comparison TableRows for features, columns for plans: scannable ✓/— marks, the recommended plan's whole column highlighted, rows tinting on hover — a textbook on scannable tabular data.
Hero Pricing CardOne big card on a gradient stage: an oversized price figure, four feature lines, a prominent button and fine print below — the pricing page for single-plan products, all about hierarchy and button presence.
Glass ButtonTranslucent glass buttons on a colorful gradient: rgba white fill, backdrop-filter frosting and a thin bright border, brightening on hover. Glassmorphism moved from cards onto buttons — light, copy-ready.
Border Draw ButtonHover a transparent button and its border appears to be drawn: two pseudo-element lines growing with scaleX/scaleY on staggered timing, closing the loop. The classic pure-CSS way to fake a drawing motion.
Pill Button GroupA three-segment control: three options joined into one pill, the selected one dark with white text and a shadow, the rest light with hover tint. The go-to list/view switcher, where rounded-corner seams are the detail that matters.
Stats Metric CardThree stat cards: a big figure, a label, an up/down arrow in green or red, and a mini trend bar. The opening component of any dashboard, where the size/weight contrast of the number is the whole point.
Product CardAn e-commerce product card: gradient image placeholder, a 'New' corner badge, title, struck-through original price next to the current one, and an add-to-cart button; the whole card lifts on hover. The smallest complete unit of a shop grid.
Timeline CardA vertical timeline: one line threading four node dots, the current one enlarged with a halo, dates and events to the side. Version histories, order tracking and résumés all ride on this pattern.
Tab NavigationFour tabs where the active one gets a thick underline and dark text, the rest sit gray until hover, with a content panel below. The workhorse of detail and settings pages, animated by the promise of that sliding underline.
Mega Menu NavHover a top-level nav item and a full-width panel unfurls: link groups in columns with icons and descriptions. Pure CSS :hover/:focus-within drives it — the way big sites surface a whole information architecture.
Sticky Headerposition: sticky keeps the nav pinned as you scroll, with a shadow fading in and z-index holding it above content. Enough filler text is included so you can scroll and feel it, plus how sticky pairs with scroll-margin.
Dots Wave LoaderSix dots rise and fall in a wave: one keyframes shared by all, staggered by evenly increasing animation-delay, with opacity and translateY moving together. The primer on staggered timing.
Orbit LoaderA glowing core with a small ball orbiting on a track: rotate the parent, translate the child — the classic split of duties between two transforms, and the minimal prototype for every planetary orbit effect.
Custom Range SliderStrip input[type=range] with appearance: none and rebuild it: gradient-filled track plus a round thumb that scales on hover. Range inputs vary the most across browsers — this recipe is the rescue.
File Upload DropzoneA dashed dropzone: folder icon, 'click or drag files here', plus format and size limits; hover recolors the border and tints the fill. The entire visual shell of an upload component in one go.
Two-Factor VerificationThe second gate of login: lock icon, a line saying the code went to your phone, four code boxes, a verify button, and a grayed 'resend in 58s'. The standard structure of a security step page.
PIN Pad LoginLock-screen style: four dots with two already filled, above a 3×4 keypad (1-9, blank, 0, backspace). The unlock paradigm of mobile and kiosk devices, built on grid layout with rounded key tiles.
Marker HighlightKey phrases get a slanted gradient band like a marker stroke, expanding or deepening on hover. The trick for emphasis in body copy — far prettier and more flexible than <mark>.
Shimmer TextFill the text with a wide gradient — metallic or gold — and loop background-position so the sheen sweeps across. Same DNA as gradient text, one animation away from a headline that glows.
Layered 3D TextEight text-shadow layers offset a pixel each build up thickness; on hover the offsets grow for a tilt illusion — 3D lettering without any 3D transform, an old-school move that still holds up.
Balloon 404 PagePure-CSS balloons — ellipse, string, highlight — drifting gently on a pale blue sky around a big 404 and a line of copy. A light-hearted 404 for consumer-facing products.
Space 404 PageA deep-space backdrop with scattered stars, a ringed planet, and an outlined 404 floating at center. A cosmos assembled from radial-gradients and border-radius — no images, no apology.
Avatar StackA stack of overlapping avatars: negative margin-inline-start plus white rings to separate them, the last circle counting '+12'. The 'who's here' marker of collaboration tools, fanning out slightly on hover.
Progress StepsA four-step flow bar: completed steps solid with a check, the current one enlarged with a halo, upcoming ones gray, connected by lines. The standard visualizer for checkout, signup and approval flows.
Plan Toggle CardsThree horizontal plan cards — monthly, quarterly, yearly — where the chosen one highlights and enlarges, with the matching price area below. A more legible period switcher than a toggle when cycles differ a lot.
Mobile Comparison PricingA narrow two-column comparison (Basic/Pro): the feature-name column sticks with position: sticky, rows alternate shades for easy horizontal reading. A table that survives small screens — the mobile-first trade-off that matters.
Pricing EstimatorA team-size slider beside a live price card: big figure, per-seat rate and a breakdown row. The custom slider plus price hierarchy that lifts SaaS conversion — the math needs JS, this example owns the shell.
auto-fit vs auto-fillSide-by-side comparison: with an unfilled last row, auto-fill keeps empty tracks (cards stay left-aligned) while auto-fit collapses them (cards stretch to fill). Drag the window to watch both reflow — zero media queries.
Fix Grid Overflow with minmax(0, 1fr)Reproduces the classic broken-grid bug: a long URL blows its 1fr track open and crushes the neighbor column. Compare the fixed minmax(0, 1fr) version, with the three fixes (track minmax / item min-width:0 / content overflow-wrap).
No examples at this difficulty in this category