CHAPTER 45
CSS Rounded Corners
Learn how border-radius creates rounded corners and modern card shapes.
01. What is CSS Rounded Corners?
The border-radius property rounds the corners of an element.
It can be applied to boxes, buttons, images and cards.
Different values can create circles, pills and custom rounded shapes.
02. Syntax
selector {
border-radius: value;
}
03. Example
CSS / HTML Example
AIFA Coding Lab
<!DOCTYPE html>
<html>
<head>
<style>
.card {
width: 300px;
padding: 30px;
background: #2563eb;
color: white;
border-radius: 20px;
}
.circle {
width: 120px;
height: 120px;
background: #06b6d4;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="card">
<h2>AIFA</h2>
<p>
Rounded card design.
</p>
</div>
<br>
<div class="circle"></div>
</body>
</html>
04. Important Points
✓
border-radius controls corner rounding.
✓
50% can create a circle when width and height are equal.
✓
Different corners can have different values.
✓
Rounded corners are common in modern UI design.
05. Common Mistakes
⚠
Using excessive rounding everywhere.
⚠
Creating inconsistent corner styles across a design system.
⚠
Forgetting that circles need equal width and height.
06. Real World Use
Rounded corners are widely used in cards, buttons, profile images, input fields, modals and modern web interfaces.
Ready to Practice? 🚀
Open the AIFA CSS Editor and practice this chapter live.
Try It Yourself →
Practice Exercise
Create a Rounded Card
Create a card with 20px rounded corners and a circular profile placeholder using border-radius: 50%.