VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-cards-sizing-using-custom-css/

⇱ Bootstrap 5 Cards Sizing using custom CSS - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Cards Sizing using custom CSS

Last Updated : 28 Apr, 2025

Bootstrap 5 card component provides a flexible and extensible content container with multiple variants and options. It includes options for headers and footers. Cards support a wide variety of content, including images, text, list groups, links, and more.

Cards using custom CSS is used to set the custom CSS styles in external stylesheets or as inline styles to set the width of the card.

Syntax:

<div class="card" style="...">
 <div class="card-body">
 Content
 </div>
</div>
 

Example 1: In this example, we will set the width of the card using inline CSS.

Output:

👁 Image
 

Example 2: In this example, we will set the width of the card using an external stylesheet.

File Name: style.css

HTML File: We will import style.css in this HTML File.

Output:

👁 Image
 

Reference: https://getbootstrap.com/docs/5.0/components/card/#using-custom-css

Comment

Explore