Menu
CoddyTech

Rounded Corners

Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 17 of 55.

A badge with rounded-lg gets an 8-pixel corner radius in the default theme. Rounding changes the shape of the background and border, not the element width.

<div class="bg-black text-white p-4 rounded-lg">Museum sample</div>

A suffix can target an edge or corner, while a plain rounded utility affects all corners. The shape remains a rectangle in document flow, so rounding does not push neighboring boxes away. The default radius scale includes rounded-sm (4px), rounded-md (6px), rounded-lg (8px), rounded-xl (12px), rounded-2xl (16px) and rounded-3xl (24px).

challenge icon

Challenge

Easy

Round all corners of the membership card to 16 pixels.

Keep the supplied content and element IDs. Edit the HTML utility classes or the requested CSS. Click Run preview to refresh the preview after edits, then use Check/Run code to grade your work.

Try it yourself

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="target" class="bg-black text-white p-4">Member</div>
</body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals