agyanadda@gmail.com

Bootstrap Borders and Shadows

Content and Utilities 1 min read Updated Dec 1, 2026 Topic 10 of 32

Borders

  • Add: border, border-top, border-end, border-bottom, border-start
  • Remove: border-0, border-top-0
  • Colour: border-primary, border-danger, border-success-subtle
  • Width: border-1 to border-5

Rounded corners

Class Shape
rounded small radius
rounded-3, rounded-5 bigger radius
rounded-pill pill shape
rounded-circle circle (use on a square)
rounded-top, rounded-end one side only

Shadows

shadow-none, shadow-sm, shadow, shadow-lg — add depth to cards and boxes.

Combine them: border-0 rounded-4 shadow-sm gives a modern card look.

Example

Example — Borders, radius and shadows HTML
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">

<div class="container my-3 d-flex flex-wrap gap-3">
  <div class="border p-3">border</div>
  <div class="border border-3 border-danger p-3">border-3 danger</div>
  <div class="border-bottom border-primary border-4 p-3">bottom only</div>
  <div class="bg-light rounded-4 shadow-sm p-3">rounded-4 shadow-sm</div>
  <div class="bg-light rounded shadow-lg p-3">shadow-lg</div>
  <span class="badge bg-success rounded-pill align-self-center">rounded-pill</span>
  <div class="bg-warning rounded-circle d-flex align-items-center justify-content-center" style="width: 80px; height: 80px;">circle</div>
</div>

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which class makes a square image round?

Exercise 2 True / False

shadow-lg gives a bigger shadow than shadow-sm.

Exercise 3 Fill in the Blank

border-___ removes all borders.

Frequently Asked Questions

Yes. Use your own CSS, for example .card { border-radius: 20px; }, loaded after Bootstrap.