VOOZH about

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

⇱ Bootstrap 5 Cards Sizing - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Cards Sizing

Last Updated : 9 May, 2024

Bootstrap Cards Sizing refers to the ability to control the dimensions of cards in Bootstrap by using predefined classes such as col, col-sm, col-md, col-lg, col-xl, and col-xxl. This ensures consistency and responsiveness across various screen sizes, maintaining a uniform appearance for card elements.

Bootstrap 5 Cards Sizing can set the width of the card using custom CSS, grid classes, grid Sass mixins, or utilities.

ClassDescription
colSets the column width equally for all screen sizes.
col-smAdjust the column width for small-sized screens.
col-mdAdjusts the column width for medium-sized screens.
col-lgAdjusts the column width for large-sized screens.
col-xlAdjusts the column width for extra-large screens.
col-xxlAdjusts the column width for extra-large screens.

Examples of Bootstrap Cards Sizing

Example 1: In this example, we will learn about Cards using custom CSS, and set the size of cards using inline CSS

Output

👁 Bootstrap-5-Card-Sizing
Bootstrap 5 Cards Sizing Example

Example 2: Bootstrap 5 Cards Sizing example utilizes "w-75" class to set card width to 75% of the parent container, displaying an image and text content for Java programming language.

Output:

👁 Bootstrap-5-Cards-Sizing-Example-2
Bootstrap 5 Cards Sizing Example Output


Comment

Explore