CSS · CSS Advanced · Lesson 42
CSS Rounded Corners
border-radius for rounded boxes and circles.
The border-radius property defines the radius of an element's corners.
Example
<style>
div { padding: 20px; width: 200px; height: 80px; margin: 10px; display: inline-block; color: white; }
.r1 { border-radius: 25px; background: #04AA6D; }
.r2 { border-radius: 15px 50px; background: dodgerblue; }
.r3 { border-radius: 50%; width: 80px; background: tomato; }
</style>
<div class="r1">25px</div>
<div class="r2">15px 50px</div>
<div class="r3">50%</div>
Tip: border-radius: 50% on a square element makes a circle.
Keep reading “CSS Rounded Corners”
Sign up to read the full lesson, try every example in the live editor, and take the 5-question quiz.