VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstarp-5-grid-system-responsive-classes/

⇱ BootStrap5 Grid system Responsive classes - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

BootStrap5 Grid system Responsive classes

Last Updated : 15 Apr, 2024

Bootstrap 5 Grid System Responsive classes offer six tiers (xs, sm, md, lg, xl) to customize column sizes, enabling the creation of responsive layouts. This allows seamless adaptation to various screen sizes for optimal user experience.

Bootstrap 5 Grid system Responsive Options:

ConceptDescription
All breakpointsWhen you need a particularly sized column, you can use this component of responsive classes. This provides .col and .col* classes to specify a numbered class.
Stacked to horizontalTo create a basic grid system that starts out stacked and becomes horizontal, you can use the set of .col-sm-* classes.
Mix and matchSimply stack in some grid tiers to your columns. Use a combination of different classes for each tier as per the need.
Row columnsUse the row columns classes .row-cols-* to quickly create basic grid layouts or to control your card layouts and override when needed at the column level.

Examples of BootStrap5 Grid system Responsive classes

Example 1: In this example we demonstrates Bootstrap 5's responsive grid system, with columns stacking on mobile. One column is full-width, and the other is half-width on larger screens.

Output:

👁 ResponsiveClass
BootStrap5 Grid system Responsive classes Example Output


Example 2: In this example we are showcases Bootstrap 5's responsive grid system with different column layouts. Columns adjust based on screen size, offering flexibility in designing layouts.

Output:

👁 ResponsiveClass2
BootStrap5 Grid system Responsive classes Example Output
Comment

Explore