Skip to content

CSS Showcase · Live Demo

Group it, name it, disable it.

Fieldset and legend do what divs can't: named form groups with a floating border title, a real accessible name for radio groups, and one-attribute disabling.

Featured demo

mobile · stacked
Order
Pro plan$18.00
2 seats$36.00
Total$54.00
Payment

mobile design patterns

fieldset-stacked.css
/* Stacked sections on mobile */
.section-stack {
  display: grid;
  gap: 1rem;
}

.section-stack .fieldset {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.9rem 1rem 1.1rem;
  display: grid;
  gap: 0.7rem;
  background: var(--card);
}

.section-stack legend {
  padding-inline: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.section-stack .summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.section-stack .summary-row span:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

CSS features used

  • • fieldset + legend
  • • fieldset:disabled
  • • :has(input:checked)
  • • accent-color on radios
  • • color-mix() tints
  • • Semantic tokens

CSS Showcase · Share

Share this demo as a 1:1 image

A 2048×2048 PNG with the live current view, the title, and the CSS features — for social posts, docs, and READMEs.

The snapshot follows the device selected on the page — switch between desktop, iPad, and mobile above and the card updates.