Dev Helpers

CSS / Borders and effects

Round every corner

Dev Helpers · July 26, 2025

A radius follows the border box. Child backgrounds can still paint outside the curve unless clipping or matching radii are part of the design.

Worked example

<style>
  .demo {
    border-radius: 1rem;
  }
</style>
<div class="demo">Round every corner</div>

Implementation notes

A rounded border with an overflowing image is a layering problem. Clip the image wrapper instead of clipping the entire card if keyboard outlines need to escape it.

Try it yourself

Put a contrasting image inside the rounded container.

Open the CSS example →

Editorial date July 26, 2025 · Published December 6, 2026

Related articles

Fluid width with a maximum

A fluid container needs a small-screen width and a large-screen maximum. Outer gutters should remain visible at both extremes.

Square aspect ratio

A square ratio reserves equal sides even before media loads. Fit rules decide whether rectangular content is cropped or letterboxed.