Responsive Card Design with Bootstrap 5.3: Create Stunning Card Layouts for Your Website


In Bootstrap 5.3, a "card" is a versatile UI component used to present content in a visually appealing and structured manner. It is designed to display a variety of information, such as text, images, links, buttons, and more, in a compact and organized format. Cards are widely used in web development for creating intuitive and responsive user interfaces.

Here are some key features and characteristics of cards in Bootstrap 5.3:

  1. Responsive Design: Cards in Bootstrap 5.3 are built with a mobile-first approach, ensuring that they adapt seamlessly to different screen sizes and devices. They automatically adjust their layout and content to provide an optimal viewing experience.
  2. Grid System Integration: Cards can be easily placed within Bootstrap's grid system, allowing you to create flexible and responsive card layouts. You can combine multiple cards in a row or within columns to achieve the desired structure.
  3. Header and Footer: Each card can have a header and/or a footer section. The header typically contains a title or an image, while the footer can include additional information, such as buttons, badges, or meta data.
  4. Content Variations: Bootstrap 5.3 provides several content options for cards. You can include plain text, images, lists, tables, forms, or even embed videos within the card body. This flexibility allows you to present diverse types of content efficiently.
  5. Card Styles: Bootstrap offers different card styles to match your design preferences. You can choose from basic cards, cards with borders, cards with shadows, or even customize the styles using CSS.
  6. Card Components: Bootstrap 5.3 provides various card components that can be added to enhance functionality. These components include buttons, dropdowns, navigation tabs, progress bars, and more, which can be integrated seamlessly into the card layout.
  7. Card Groups: You can group multiple cards together using the card group component. This is useful when you want to display a collection of related content, such as a set of blog posts, products, or user profiles.

Simple Card Image Top

In Bootstrap 5.3, the "Simple Card Image Top" is a specific card style that features an image at the top of the card with simple content below it. This card style is commonly used to display an image alongside a brief description, title, or other relevant information. It provides a clean and visually appealing layout.

Here's how you can create a Simple Card Image Top in Bootstrap 5.3:

<div class="card" style="width: 450px">
    <img src="images/animal.jpg" alt="animal" class="card-img-top" />
    <div class="card-body">
        <h5 class="card-title">History of Animals</h5>
        <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>
        <a href="#" class="btn btn-primary">Read More</a>
        <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
    </div>
</div>
  • <div class="card" style="width: 450px"> : This <div> element with the class "card" creates the card container. The style attribute sets the width of the card to 450 pixels.
  • <img src="images/animal.jpg" alt="animal" class="card-img-top" /> : The <img> element represents the image displayed at the top of the card. The src attribute specifies the path to the image file, while the alt attribute provides alternative text for the image. The class "card-img-top" positions the image at the top of the card.
  • <div class="card-body">: This <div> element with the class "card-body" contains the content of the card, such as the title, description, and buttons.
  • <h5 class="card-title">History of Animals</h5> : The <h5> element with the class "card-title" represents the title of the card, which in this case is "History of Animals".
  • <p class="card-text">Lorem ipsum...</p> : The <p> element with the class "card-text" contains the description or text content of the card. In this example, it includes placeholder text starting with "Lorem ipsum dolor sit...".
  • <a href="#" class="btn btn-primary">Read More</a> : This <a> element with the classes "btn btn-primary" creates a button with the label "Read More". The "#" in the href attribute is a placeholder for the URL the button should link to.
  • <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a> : This <a> element with the classes "btn btn-success" creates a button with a heart icon using Bootstrap icons. The <i> element with the classes "bi bi-heart" represents the heart icon.

Overall, this code creates a card with an image at the top, followed by a title, description, and two buttons. The image, title, description, and buttons can be customized with your own content and styling to suit your needs.

Simple Card Image Bottom

In Bootstrap 5.3, the "Simple Card Image Bottom" is a card style where the image is positioned at the bottom of the card, with the content displayed above it. This layout is useful when you want to showcase an image that complements the card content or serves as a visual representation related to the card's information.

Here's an example of how to create a Simple Card Image Bottom in Bootstrap 5.3:

<div class="card" style="width: 450px">
    <img src="images/animal.jpg" alt="animal" class="card-img-top" />
    <div class="card-body">
        <h5 class="card-title">History of Animals</h5>
        <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>
        <a href="#" class="btn btn-primary">Read More</a>
        <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
    </div>
</div>

By following this structure and applying the appropriate CSS classes, you can create a Simple Card Image Bottom in Bootstrap 5.3. Customize the content, styling, and image source to meet your specific design requirements.

Remember to ensure the image you use is properly sized and optimized for display in the card, considering both desktop and mobile viewing experiences.

Card Body With Links

In Bootstrap 5.3, the "Card Body With Links" is a card component that allows you to include links within the card's body content. This feature is useful for adding clickable elements, such as buttons, text links, or interactive icons, that direct users to specific destinations or perform actions.

<div class="card">
    <div class="card-body">
      <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Libero saepe distinctio illum, tenetur, in similique enim eos excepturi doloremque corrupti laboriosam unde veritatis nostrum blanditiis esse eveniet quis, error rerum.</p>
      <a href="#" class="card-link">Card Link</a>
      <a href="#" class="card-link">Read More</a>
    </div>
</div>

To create a Card Body With Links in Bootstrap 5.3, follow these steps:

  • Start with the basic card structure using the <div> element with the class "card".
  • Inside the card, place the content within the <div> element with the class "card-body". This is where you'll include your text, buttons, or other elements that will serve as links.
  • Add the desired links using appropriate HTML tags. For example, you can use the <a> tag to create clickable text links or the <button> tag to create interactive buttons. Apply Bootstrap classes, such as "btn" and "btn-link," to style the links as needed.

Horizontal Card

In Bootstrap 5.3, a "Horizontal Card" is a card layout where the card content, such as the image and text, is arranged horizontally instead of the traditional vertical layout. This layout is often used when you have an image or media element associated with a description or details that are displayed side by side.

To create a Horizontal Card in Bootstrap 5.3, follow these steps:

  • Start with the basic card structure using the <div> element with the class "card".
  • Inside the card, use the Bootstrap grid system to create a row and divide it into columns. Place the image or media element in one column and the text or description in another column.
  • Apply appropriate Bootstrap classes to control the column sizes and alignment.

Here's an example of a Horizontal Card in Bootstrap 5.3:

<div class="card" style="width: 800px">
    <div class="row">
      <div class="col-md-6">
        <img src="images/baby.jpg" class="img-fluid rounded-start h-100 object-fit-fill" alt="baby" />
      </div>
      <div class="col-md-6">
        <div class="card-body">
          <h5 class="card-title">Baby Title</h5>
          <p class="card-text">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Totam nostrum repudiandae nobis suscipit consequatur doloribus reprehenderit tempora ea dolore debitis quo illum, voluptates odio ab laboriosam autem qui voluptatibus hic?</p>
          <p class="text-secondary"><small>Last Updated 3 Mins ago</small></p>
        </div>
      </div>
    </div>
</div>

By utilizing the Horizontal Card layout, you can present content in a visually appealing side-by-side arrangement. Adjust the column sizes, content, and styling to suit your specific needs and design preferences.

Card Groups

In Bootstrap 5.3, "Card Groups" is a component that allows you to group multiple cards together, creating a visually cohesive and organized display of related content. Card Groups are commonly used when you have a collection of cards that share a common theme or belong to a specific category.

To create Card Groups in Bootstrap 5.3, follow these steps:

  • Start with a container element (such as a <div>) to wrap the card group.
  • Within the container, add individual card elements using the <div> element with the class "card".
  • Customize the content, layout, and styling of each card as desired. This includes the card header, image, body content, footer, and any additional components you want to include.

Here's an example of how to create Card Groups in Bootstrap 5.3:

<div class="card-group">
    <div class="card">
      <img src="images/animal.jpg" alt="animal" class="card-img-top" />
      <div class="card-body">
        <h5 class="card-title">History of Animals</h5>
        <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

        <a href="#" class="btn btn-primary">Read More</a>
        <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
      </div>
    </div>
    <div class="card">
      <img src="images/flower.jpg" alt="animal" class="card-img-top" />
      <div class="card-body">
        <h5 class="card-title">History of Flowers</h5>
        <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

        <a href="#" class="btn btn-primary">Read More</a>
        <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
      </div>
    </div>
    <div class="card">
      <img src="images/bird.jpg" alt="animal" class="card-img-top" />
      <div class="card-body">
        <h5 class="card-title">History of Birds</h5>
        <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

        <a href="#" class="btn btn-primary">Read More</a>
        <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
      </div>
    </div>
</div>

Card Grid

In Bootstrap 5.3, the "Card Grid" is a layout structure that allows you to display a grid of cards in a responsive and organized manner. The Card Grid provides a flexible way to present multiple cards in rows and columns, making it ideal for showcasing collections, galleries, or sets of related content.

To create a Card Grid in Bootstrap 5.3, follow these steps:

  • Start with a container element (such as a <div>) to wrap the card grid.
  • Within the container, create a row using the <div> element with the class "row".
  • Inside the row, add individual card elements using the <div> element with the class "col" or "col-*" (e.g., "col-4", "col-md-6"). The "col" classes define the column width for each card.
  • Customize the content, layout, and styling of each card as desired. This includes the card header, image, body content, footer, and any additional components you want to include.

Here's an example of how to create a Card Grid in Bootstrap 5.3:

<div class="row row-cols-lg-3 row-cols-md-2 row-cols-sm-1 g-4">
    <div class="col-sm-12">
      <div class="card">
        <img src="images/animal.jpg" alt="animal" class="card-img-top" />
        <div class="card-body">
          <h5 class="card-title">History of Animals</h5>
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

          <a href="#" class="btn btn-primary">Read More</a>
          <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
        </div>
      </div>
    </div>
    <div class="col-sm-12">
      <div class="card">
        <img src="images/flower.jpg" alt="animal" class="card-img-top" />
        <div class="card-body">
          <h5 class="card-title">History of Flowers</h5>
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

          <a href="#" class="btn btn-primary">Read More</a>
          <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
        </div>
      </div>
    </div>
    <div class="col-sm-12">
      <div class="card">
        <img src="images/bird.jpg" alt="animal" class="card-img-top" />
        <div class="card-body">
          <h5 class="card-title">History of Birds</h5>
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

          <a href="#" class="btn btn-primary">Read More</a>
          <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
        </div>
      </div>
    </div>
    <div class="col-sm-12">
      <div class="card">
        <img src="images/baby.jpg" alt="animal" class="card-img-top" />
        <div class="card-body">
          <h5 class="card-title">History of Baby</h5>
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

          <a href="#" class="btn btn-primary">Read More</a>
          <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
        </div>
      </div>
    </div>
</div>

By utilizing the Card Grid in Bootstrap 5.3, you can create responsive and visually appealing arrangements of multiple cards. Adjust the column classes, content, and styling to suit your specific needs and design preferences.

Card Image Overlay

In Bootstrap 5.3, the "Card Image Overlay" is a feature that allows you to overlay content, such as text or buttons, on top of an image within a card. This effect creates an engaging visual presentation where the image serves as the background, and the overlay provides additional information or interactive elements.

Here's an example of how to create a Card image overlay in Bootstrap 5.3:

  • Start with the basic card structure using the <div>div> element with the class "card".
  • Inside the card, place the image within the <img> element and add the class "card-img" to it.
  • Create the overlay content using a <div>div> element with the class "card-img-overlay". Inside this element, add the desired content, such as text, buttons, or other elements.
  • Customize the overlay content by applying appropriate styles, such as text color, background color, or opacity.

Here's an example of how to create a Card Image Overlay in Bootstrap 5.3:

<div class="card">
    <img src="images/baby.jpg" class="card-img" alt="..." />
    <div class="card-img-overlay">
      <h4 class="card-title text-white">Card Title</h4>
      <p class="card-text text-light">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Libero saepe distinctio illum, tenetur, in similique enim eos excepturi doloremque corrupti laboriosam unde veritatis nostrum blanditiis esse eveniet quis, error rerum.</p>
    </div>
</div>

By using the Card Image Overlay feature in Bootstrap 5.3, you can create visually appealing cards with engaging image backgrounds and overlaying content. Customize the image, overlay content, and styling to achieve the desired effect and meet your specific design requirements.

Example

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Card</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="css/style.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" />
  </head>
  <body>
    <div class="container my-5">
      <p class="fw-semibold fs-5 text-primary">Card in Bootstrap</p>
      <p>Simple Card Image Top</p>
      <div class="card" style="width: 450px">
        <img src="images/animal.jpg" alt="animal" class="card-img-top" />
        <div class="card-body">
          <h5 class="card-title">History of Animals</h5>
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

          <a href="#" class="btn btn-primary">Read More</a>
          <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
        </div>
      </div>

      <hr class="my-5" />
      <p>Simple Card Image Bottom</p>
      <div class="card" style="width: 450px">
        <div class="card-body">
          <h5 class="card-title">History of Animals</h5>
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

          <a href="#" class="btn btn-primary">Read More</a>
          <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
        </div>
        <img src="images/animal.jpg" alt="animal" class="card-img-bottom" />
      </div>

      <hr class="my-5" />
      <p>Card Body</p>
      <div class="card bg-danger text-bg-danger">
        <div class="card-body">
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Libero saepe distinctio illum, tenetur, in similique enim eos excepturi doloremque corrupti laboriosam unde veritatis nostrum blanditiis esse eveniet quis, error rerum.</p>
        </div>
      </div>

      <hr class="my-5" />
      <p>Card Body With Links</p>
      <div class="card">
        <div class="card-body">
          <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Libero saepe distinctio illum, tenetur, in similique enim eos excepturi doloremque corrupti laboriosam unde veritatis nostrum blanditiis esse eveniet quis, error rerum.</p>
          <a href="#" class="card-link">Card Link</a>
          <a href="#" class="card-link">Read More</a>
        </div>
      </div>

      <hr class="my-5" />
      <p>Horizontal Card</p>

      <div class="card" style="width: 800px">
        <div class="row">
          <div class="col-md-6">
            <img src="images/baby.jpg" class="img-fluid rounded-start h-100 object-fit-fill" alt="baby" />
          </div>
          <div class="col-md-6">
            <div class="card-body">
              <h5 class="card-title">Baby Title</h5>
              <p class="card-text">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Totam nostrum repudiandae nobis suscipit consequatur doloribus reprehenderit tempora ea dolore debitis quo illum, voluptates odio ab laboriosam autem qui voluptatibus hic?</p>

              <p class="text-secondary"><small>Last Updated 3 Mins ago</small></p>
            </div>
          </div>
        </div>
      </div>

      <hr class="my-5" />
      <p>Card Groups</p>

      <div class="card-group">
        <div class="card">
          <img src="images/animal.jpg" alt="animal" class="card-img-top" />
          <div class="card-body">
            <h5 class="card-title">History of Animals</h5>
            <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

            <a href="#" class="btn btn-primary">Read More</a>
            <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
          </div>
        </div>
        <div class="card">
          <img src="images/flower.jpg" alt="animal" class="card-img-top" />
          <div class="card-body">
            <h5 class="card-title">History of Flowers</h5>
            <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

            <a href="#" class="btn btn-primary">Read More</a>
            <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
          </div>
        </div>
        <div class="card">
          <img src="images/bird.jpg" alt="animal" class="card-img-top" />
          <div class="card-body">
            <h5 class="card-title">History of Birds</h5>
            <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

            <a href="#" class="btn btn-primary">Read More</a>
            <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
          </div>
        </div>
      </div>

      <hr class="my-5" />
      <p>Card Grid</p>

      <div class="row row-cols-lg-3 row-cols-md-2 row-cols-sm-1 g-4">
        <div class="col-sm-12">
          <div class="card">
            <img src="images/animal.jpg" alt="animal" class="card-img-top" />
            <div class="card-body">
              <h5 class="card-title">History of Animals</h5>
              <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

              <a href="#" class="btn btn-primary">Read More</a>
              <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
            </div>
          </div>
        </div>
        <div class="col-sm-12">
          <div class="card">
            <img src="images/flower.jpg" alt="animal" class="card-img-top" />
            <div class="card-body">
              <h5 class="card-title">History of Flowers</h5>
              <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

              <a href="#" class="btn btn-primary">Read More</a>
              <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
            </div>
          </div>
        </div>
        <div class="col-sm-12">
          <div class="card">
            <img src="images/bird.jpg" alt="animal" class="card-img-top" />
            <div class="card-body">
              <h5 class="card-title">History of Birds</h5>
              <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

              <a href="#" class="btn btn-primary">Read More</a>
              <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
            </div>
          </div>
        </div>
        <div class="col-sm-12">
          <div class="card">
            <img src="images/baby.jpg" alt="animal" class="card-img-top" />
            <div class="card-body">
              <h5 class="card-title">History of Baby</h5>
              <p class="card-text">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Tempore beatae nostrum officia? Dolores minus ullam recusandae perferendis unde, odio qui quia officia et at illo delectus adipisci quisquam, libero id.</p>

              <a href="#" class="btn btn-primary">Read More</a>
              <a href="#" class="btn btn-success"><i class="bi bi-heart"></i></a>
            </div>
          </div>
        </div>
      </div>

      <hr class="my-5" />
      <p>Card Image Overlay</p>

      <div class="card">
        <img src="images/baby.jpg" class="card-img" alt="..." />
        <div class="card-img-overlay">
          <h4 class="card-title text-white">Card Title</h4>
          <p class="card-text text-light">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Libero saepe distinctio illum, tenetur, in similique enim eos excepturi doloremque corrupti laboriosam unde veritatis nostrum blanditiis esse eveniet quis, error rerum.</p>
        </div>
      </div>
      <hr class="my-5" />
      <p>Card With and Footer</p>
      <div class="card">
        <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>
          <a href="#" class="btn btn-primary">Go somewhere</a>
        </div>
        <div class="card-footer">Footer</div>
      </div>

      <!--container end-->
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  </body>
</html>
Live Preview

By leveraging the features of cards in Bootstrap 5.3, you can create visually appealing and responsive layouts for displaying content on your website, making it easier for users to consume and interact with information.