You round a card, its own corners curve nicely, and then the photo at the top of the card still shows two sharp square corners stabbing past the curve. The radius is clearly working and clearly not working at the same time.
The confusion comes from expecting one property to do two jobs. border-radius shapes the element you apply it to. Clipping the elements inside it is a different behavior with a different property: overflow. This guide separates the two halves, shows the classic fix with the free Border Radius Generator on Ovatly supplying the radius, and is honest about what the clip costs when a card contains things meant to stick out.
Contents
- Quick answer
- What border-radius actually rounds
- What overflow hidden actually does
- The cost of the clip
- Worked example: a product card with a photo on top
- Which fix for which card
- Where the generator fits, and where it stops
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
border-radius rounds the parent's own background and border; it does not clip children. A square-cornered child, such as an image filling the top of a card, paints over the curved corner until you clip it. Adding overflow: hidden to the parent clips all children along the rounded shape and fixes the poke. The cost: the same clip cuts anything else that extends past the parent, including dropdowns, tooltips, badges and child shadows. When a card contains those, skip the clip and round the child's own corners instead. The Border Radius Generator supplies only the radius declaration; the overflow line is yours.
What border-radius actually rounds
A radius sets the shape of the element's own box: its background fills the rounded shape, and its border follows the curve. The element's children are rendered inside it, and nothing in the radius property tells the browser to trim them at the curve.
So a card with border-radius: 5%; and a photo child laid flush against its top edge shows you both truths at once. The card's background is rounded. The photo, a rectangle with square corners, covers the top corners completely, including the curved regions.
What overflow hidden actually does
overflow governs what happens to content that extends beyond an element's box. The default, visible, lets it spill. Setting overflow: hidden clips it at the box edge, and when the element also has a border-radius, the clip follows the rounded curve in modern browsers.
The radius alone did not clip, and overflow alone, on a square-cornered card, would clip to a square. You need both halves; tutorials that mention only one leave the bug half fixed.
The cost of the clip
overflow: hidden does not know which children you meant to trim. It clips everything that crosses the parent's boundary:
- Dropdown menus and tooltips inside the card are cut off at its edge.
- Badges and labels positioned half outside a corner, a common design touch, lose their outer half.
- Shadows of child elements that fall outside the parent are sliced along the boundary.
- Focus outlines and popovers on inner controls can be trimmed the same way.
None of this makes the property bad; it makes it a poor default to paste onto every card. Ask per card whether anything inside legitimately needs to overflow. If nothing does, clip freely. If something does, the clip is the wrong fix for that card.
Worked example: a product card with a photo on top
Take a product card 320 px wide. The design wants soft corners: build the radius in the generator with all four corners at 5 percent, which outputs the single declaration border-radius: 5%;. Applied to the card, the top corners curve by 16 px horizontally, since 5 percent of 320 px is 16 px.
The product photo sits at the top of the card, 320 px wide and 200 px tall, flush with the edges, so its square corners cover the card's curved corners exactly where the curve should show. The card looks rounded at the bottom and square at the top.
Add one line to the card's rule:
.card {
border-radius: 5%;
overflow: hidden;
}
The photo is now clipped along the curve and the card reads as one rounded object. Done for this card, because a plain product card holds nothing that needs to escape it.
Now give the same card a "New" badge positioned half outside its top-left corner. The clip cuts the badge in half along the card's edge. For this version, remove the overflow line and round the photo's own top corners to match instead: the same 5 percent on its top left and top right corners, built with the per-corner sliders, bottom corners at zero. The poke is fixed, the badge survives, nothing is clipped.
Which fix for which card
- Clip with overflow hidden when the card is a closed box: photos, text, buttons that stay inside. Most simple cards are.
- Round the child itself when anything inside must overflow: badges, dropdowns, tooltips, menus, overlapping decorations.
- Use both deliberately when several children stack: clip the inner wrapper that holds the photo, and keep the badge outside that wrapper as a sibling, not a fellow prisoner of the clip.
Where the generator fits, and where it stops
The generator's role in all of this is narrow. It produces one border-radius declaration. It has per-corner sliders, in the order top left, top right, bottom right, bottom left, so matched corners and top-only corners are both easy to build. Its Fancy mode handles elliptical corners (separate horizontal and vertical radii, slash syntax); its blob example, horizontal 30, 70, 70, 30 with vertical 30, 30, 70, 70, shows how far that goes.
It outputs percentages only, never pixels. If your card's spec is written in pixels, the generator's own FAQ suggests the bridge: take the percentage declaration and replace the % with px as a starting point, then adjust. It has no overflow setting and no clipping feature.
Limitations and honest tradeoffs
Neither property is a complete solution on its own, and the combination has the clipping cost described above. There is no setting that clips only the corners you dislike and spares the badge you like; the workarounds are structural, such as wrapping the photo in its own clipped container.
Percentage radii resolve against the element's own size, separately per axis, so a wide short card gets elliptical corners rather than circular arcs. A child rounded to match needs the same percentage values, not the same pixel values, to trace the same curve.
The generator works in your browser and uploads nothing, but it cannot inspect your page, find the poking child, or apply the fix. Diagnosis and the overflow decision remain yours.
Common mistakes
- Adding more radius to fix a poke. A bigger curve makes the square corner stick out further, not less. The missing piece is clipping, not curvature.
- Pasting overflow hidden onto every card. The first dropdown or badge inside one of those cards will be silently amputated.
- Rounding the parent and the child with different values. Mismatched curves leave a visible sliver of background along the corner. Use the same values.
- Forgetting the bottom corners. A photo at the card's foot, or a colored footer block, pokes at the bottom the same way. Check all four corners.
- Clipping a card that animates. If a child grows or slides beyond the box during an animation, the clip cuts the effect mid-motion.
FAQs
Why does my image stick out past my card's rounded corners? Because border-radius only rounds the card's own background and border. It does not clip what is inside. A child image with square corners paints right over the curved corner area until something clips it.
Does border-radius clip child elements? No. Radius changes the shape of the element's own rendering. Clipping children is a separate behavior, and in CSS it comes from overflow. The two properties solve different halves of the problem.
What does overflow hidden cut besides the poking corners? Anything that extends beyond the parent's box: dropdown menus, tooltips, badges positioned half outside, and the outer shadows of child elements. If a card contains any of those, the clip will damage them.
Can I fix poking corners without overflow hidden? Yes. Round the child's own corners to match the parent, for example giving a top image the same radius on its top corners only. The parent keeps no clip, so badges and menus can still overflow freely.
Does the generator output overflow or clipping settings? No. The Border Radius Generator produces a single border-radius declaration, in percentages only. Overflow is a separate line you write in your own stylesheet; the tool has no clipping feature.
Conclusion
Radius shapes, overflow clips, and the poking-corner bug is what happens when you ask the first to do the second's job. Build the value in the Border Radius Generator, then decide card by card whether the clip is safe or the child should carry its own matching corners. For the grid-wide version of the same value, one radius shared by every thumbnail, see our guide on rounding image corners for a gallery grid. More guides are in the Website and Webmaster Tools guides.
References
- MDN Web Docs, on border-radius and how it renders an element's background and border: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
- MDN Web Docs, on the overflow property and clipping: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow