Tsallaka zuwa abun ciki
Justice Tech School

Rounded Corners

border-radius rounds the corners of an element. One value rounds all corners; four values go clockwise from top-left. Percentages are relative to the box size.

A radius of 50% on a square makes a circle, and a very large value like 999px makes a pill shape. You can also set elliptical corners with a slash: 50% / 30%.

Example
<style>
  div { display: inline-block; width: 90px; height: 90px; margin: 6px; background: #6366f1; }
  .soft { border-radius: 12px; }
  .circle { border-radius: 50%; }
  .leaf { border-radius: 0 50% 0 50%; }
  .pill { width: 160px; height: 50px; border-radius: 999px; }
</style>
<div class="soft"></div>
<div class="circle"></div>
<div class="leaf"></div>
<div class="pill"></div>

Exercise

Turn the square into a circle.

.avatar {
  width: 80px;
  height: 80px;
  border-radius: ;
}

Quiz Test

What do you need to make a circle from a square?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.