Rounded corners make boxes and buttons look softer and friendlier. They improve the look and feel of a website.
Border radius (rounded corners) in Tailwind
rounded rounded-sm rounded-md rounded-lg rounded-xl rounded-2xl rounded-3xl rounded-full rounded-t rounded-b rounded-l rounded-r rounded-tl rounded-tr rounded-bl rounded-br
Use rounded classes to add different sizes of rounded corners.
Use directional classes like rounded-tl to round only specific corners.
<div class="rounded bg-blue-500 p-4 text-white">Rounded corners</div><div class="rounded-lg bg-green-500 p-4 text-white">Large rounded corners</div><div class="rounded-tl-full bg-red-500 p-4 text-white">Only top-left corner rounded fully</div><div class="rounded-full bg-purple-500 p-4 text-white">Fully rounded (circle shape)</div>This page shows four boxes with different rounded corners using Tailwind CSS classes. Each box has a background color, padding, and white text for contrast. The boxes are stacked vertically with space between them.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Tailwind Border Radius Example</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="flex flex-col items-center gap-6 p-8 bg-gray-100 min-h-screen"> <div class="rounded bg-blue-500 p-6 text-white w-64 text-center">Default rounded corners</div> <div class="rounded-lg bg-green-500 p-6 text-white w-64 text-center">Large rounded corners</div> <div class="rounded-tl-full bg-red-500 p-6 text-white w-64 text-center">Top-left fully rounded</div> <div class="rounded-full bg-purple-500 p-6 text-white w-64 text-center">Fully rounded (pill shape)</div> </body> </html>
Rounded corners improve user experience by making elements look friendlier.
Use rounded-full to create circles or pills, but ensure width and height match for perfect circles.
Combine with shadows and colors for modern UI design.
Use Tailwind's rounded classes to add rounded corners easily.
Different sizes and directions let you customize which corners are rounded.
Rounded corners make your website look modern and approachable.