Bootstrap
Web Development
Front-End Design
CSS Styling
Cards Layout
UI Components
Responsive Design

How to Create and Style Bootstrap Cards

Deepak Tewatia
September 5, 2025
3 min read

Introduction

Bootstrap cards are a great way to display content. They help you organize information neatly and make your site look good. In this guide, we will show you how to create and style cards easily. You will learn to make cards that look good and are easy to use. Let’s break it down into simple steps.

What is a Bootstrap Card?

A Bootstrap card is a flexible and extensible content container. It can hold all sorts of content, such as text, images, and buttons. The card layout helps in structuring the information clearly. Here is what a basic card might look like:

<code class="html">
<div class="card">
  
  <div class="card-body">
    <h5 class="card-title">Card Title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>

How to Create a Simple Card

To start creating a card, you first need to include Bootstrap in your project. You can either download it or link it directly from a CDN. Here’s how you can do that:

<code class="html">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

With Bootstrap linked, you can now create a simple card. Use the code below to add a basic card to your webpage.

<code class="html">
<div class="card" style="width: 18rem;">
  
  <div class="card-body">
    <h5 class="card-title">Card Title</h5>
    <p class="card-text">This is a simple card with some text content.</p>
    <a href="#" class="btn btn-primary">Click Me</a>
  </div>
</div>

Styling Your Cards

Now that you have a card, let’s style it. You can change things like colors, borders, and shadows to make your cards pop. Here are some common styling options:

  • Background Color: Change the background color of the card body using CSS.
  • Border: Add a border by using the border class from Bootstrap.
  • Shadow: Use the shadow class to create a shadow effect.

Here’s an example of how you can style your card:

<code class="html">
<div class="card text-white bg-success mb-3" style="max-width: 18rem;">
  <div class="card-header">Header</div>
  <div class="card-body">
    <h5 class="card-title">Special title treatment</h5>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
  </div>
</div>

Adding More Features to Your Cards

Cards can be more than just simple containers. You can include lists, links, and even images. Here are some ideas:

  • Image in Card Header: Place an image in the header for a nice visual.
  • Image Gallery: Use multiple cards to create a gallery of images.
  • List Group: Add a list group inside a card for structured information.

Here is how you might create a card with a list:

<code class="html">
<div class="card">
  <div class="card-header">
    Featured
  </div>
  <ul class="list-group list-group-flush">
    <li class="list-group-item">Item 1</li>
    <li class="list-group-item">Item 2</li>
    <li class="list-group-item">Item 3</li>
  </ul>
</div>

Responsive Cards

One of the best parts about Bootstrap is how it makes your cards responsive. This means they will look good on any device. Just put your cards inside a row and columns. Here is an example:

<code class="html">
<div class="row">
  <div class="col-md-4">
    <div class="card">
      
      <div class="card-body">
        <h5 class="card-title">Card 1</h5>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="card">
      
      <div class="card-body">
        <h5 class="card-title">Card 2</h5>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="card">
      
      <div class="card-body">
        <h5 class="card-title">Card 3</h5>
      </div>
    </div>
  </div>
</div>

Conclusion

Bootstrap cards are easy to create and style. They offer a great way to display information clearly and beautifully. With just a few lines of code, you can add impressive cards to your website. Explore different styles, images, and features to make your cards unique. Now go ahead, make your own cards, and enhance your web design!

Comments

Y
You
Commenting
0/2000
Loading comments…