freecoding.school100% FREE · NO SIGNUP
Cascade FallsISSUE #16 of 33

borders · radius · individual corners

StylaVSThe Specificity Sphinx
Styla saysborder-radius rounds corners — from gentle to pill-shaped to full circles.

border-radius: 8px rounds all corners; per-corner values and the slash syntax give finer control. border-radius: 50% on a square makes a circle. It works even without a visible border, since it clips the background and box too.

Power-ups you unlock

The Specificity Sphinx attacks — common mistakes

Boss battleRound a box to 12px, make an avatar circle with 50%, and a pill with a large radius.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>.card{border-radius:12px;background:#140a28;padding:16px}.dot{width:60px;height:60px;border-radius:50%;background:#b388ff}</style></head><body style="background:#06040d;color:#e6e0ff"><div class="card">rounded card</div><br><div class="dot"></div></body></html>
▶ Open the interactive comic issue
‹ Borders · Width · Style · ColorBorders · Images · Slicing ›