Suggestions

TLDR; Not Your Typical Privacy Agreement

Powered by Cohere

Samsung Galaxy S10e

Specifications

  • Dimensions: 142.2 x 69.9 x 7.9 mm (5.60 x 2.75 x 0.31 in)
  • Weight: 150 g (5.29 oz)
  • Display: Dynamic AMOLED, HDR10+
  • Resolution: 1080 x 2280 pixels, 19:9 ratio (~438 ppi density)
  • OS: Android 9.0 (Pie), upgradable to Android 12, One UI 4.1
  • CPU: Octa-core (2x2.73 GHz Mongoose M4 & 2x2.31 GHz Cortex-A75 & 4x1.95 GHz Cortex-A55) - EMEA/LATAM
  • Main Camera: 12 MP, f/1.5-2.4, 26mm (wide)
  • Selfie Camera: 10 MP, f/1.9, 26mm (wide), 1/3", 1.22µm, dual pixel PDAF
  • Battery: Li-Ion 3100 mAh, non-removable
All Notes

Mastering border-radius in CSS: Make Your UI Smooth & Stylish

Wednesday, June 25, 2025
Author:
Share to Reddit
Share to Facebook
Share to X
Share to LinkedIn
Share to WhatsApp
Share by email
Describing the associated blog post


Introduction

If you're aiming to create sleek, modern interfaces, the border-radius property in CSS is a must-know tool. With just one line of code, you can transform harsh corners into soft, inviting visuals that elevate the user experience.

In this post, we’ll break down what border-radius does, how to use it effectively, and explore creative ways to bring your designs to life.

💡 What is border-radius?

border-radius is a CSS property that allows you to round the corners of an element’s border box.

.box {
  border-radius: 10px;
}

This creates a smooth 10-pixel curve on all four corners.

10px Border Radius

🔄 Basic Syntax

You can apply border-radius in several ways:

🔹 One Value (All Corners)

border-radius: 15px;

Applies 15px rounding to all corners.

15px Border Radius

🔹 Two Values (Top-Bottom / Left-Right)

border-radius: 15px 5px;
  • Top-left & bottom-right: 15px
  • Top-right & bottom-left: 5px

15px and 5px border radius

🔹 Four Values (Clockwise: TL, TR, BR, BL)

border-radius: 10px 20px 30px 40px;
  • Top-left: 10px
  • Top-right: 20px
  • Bottom-right: 30px
  • Bottom-left: 40px

Four value border radius

🔹 Elliptical Corners

You can also define horizontal and vertical radii:

border-radius: 50px / 25px;

Horizontal/Vertical border radius

🧠 Use Cases

  • Buttons: Make CTAs stand out and look friendly.
  • Cards: Give cards a soft, elevated aesthetic.
  • Images: Create circular or rounded image frames.
  • Modals & Popups: Enhance UX with less rigid borders.

🧪 Pro Tip: Fully Rounded Elements

Want to create a perfect circle?

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

Use border-radius: 50% on a square element for a flawless circle.

Full circle border radius

❗Common Mistakes

  • Don't apply large radii to small elements; it can distort appearance.
  • Remember: border-radius won’t hide overflow unless overflow: hidden is also used.
  • Use px, %, or em depending on layout needs.

🎨 Bonus: Creative Corner Shapes

.card {
  border-radius: 50px 0 50px 0;
}

Creates an asymmetric, playful corner style — great for branding and unique UI designs!

Asymmetric border radius

Conclusion

Whether you're working on a corporate dashboard or a playful landing page, border-radius is your gateway to polished, modern UI design. With minimal effort, you can deliver visually pleasing layouts that feel intentional and easy on the eyes.

Now that you’ve mastered border-radius, why not give your next design a soft edge?

🚀 Keep Exploring

Tawanda Andrew Msengezi

Tawanda Andrew Msengezi is a Software Engineer and Technical Writer who writes all the articles on this blog. He has a Bachelor of Science in Computer Information Systems from Near East University. He is an expert in all things web development with a specific focus on frontend development. This blog contains articles about HTML, CSS, JavaScript and various other tech related content.

User Notice

Dear Visitor,

This website stores your color theme preference, you can toggle your theme preference using the lightbulb icon in the top right of the webpage.

Clicking on the robot icon that says 'Chat' in the bottom-left corner will open a chat with an AI assistant. Click the button below to close this message.