Přejít k hlavnímu obsahu
← 🎨 CSS as a design system·Modul B9 · Lekce 7
ÚkolBuild a 3-tier pricing layout. .pricing has display: grid, grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)), gap: var(--space-md). Each .tier has padding var(--space-lg), background var(--surface), border 1px solid var(--border), border-radius var(--radius-lg). .tier.featured has scale(1.02), border-color var(--primary), box-shadow var(--shadow-lg), position: relative. .tier.featured::before has content 'Most popular', position absolute, top: -10px, padding: 4px 12px, background: var(--primary), color: white, font-size: 11px, border-radius: var(--radius-pill). .tier h3 = plan name, .tier .price = big font-size 36px, .tier ul = features list with no list-style, .tier .cta = button. Three plans: Free, Pro $12, Team $39. Pro is featured.

Capstone 7: Stránka s cenami (proužkový styl)

250 XP16 min
Teorie

A pricing page that converts

Three tiers side-by-side. The middle tier — the one you want people to pick — is visually elevated: bigger, brighter border, "Most popular" ribbon, subtle drop-shadow. This isn't decoration; it's a proven conversion pattern. Users default to the tier that reads as "the sensible middle choice", and every SaaS pricing page you've seen exploits it.

Layout tricks

  • auto-fit grid — grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)). Three cards on desktop, two on tablet, one on phone. Zero media queries. If a card can't fit at least 260px, the grid drops it to the next row.
  • align-items: start on the grid so the featured card can transform: scale(1.02) without stretching the neighbours vertically.
  • Absolute-positioned ribbon — the "Most popular" chip lives at top: -10px, left: 50%, transform: translateX(-50%) so it visually punches out of the card border.

Content shape (repeat per tier)

  1. Plan name (h3).
  2. Big price (.price — 36px+).
  3. Feature list (bulleted, no default list marker — replace li::before with "✓ " in brand colour).
  4. CTA button (filled for the featured tier, outlined for the others).
🔒

Zaregistruj se a začni programovat

Teorie je otevřená pro každého. Editor, živý náhled a check se odemknou s 7denní zkušební verzí zdarma — karta vyžadována, zrušíš kdykoli.

Registrace — zkušební verze zdarma →

Prvních 10 lekcí v každé trase je zdarma. Karta není potřeba.

← PředchozíDalší lekce →

Jeden tip k Pythonu nebo webu denně — e-mailem

Krátké, ručně psané, žádný spam. Odhlásit jedním klikem.