Hello friends! 👋
If you're learning HTML, CSS, and Web Development, then Bootstrap 5 is one of the most valuable frameworks you can master. It allows you to build beautiful, responsive, and mobile-friendly websites much faster without writing large amounts of CSS from scratch.
Whether you're creating a personal portfolio, business website, admin dashboard, landing page, blog, or e-commerce site, Bootstrap provides hundreds of ready-to-use classes and components that simplify web development.
However, beginners often struggle to remember class names like container, row, col, d-flex, justify-content-center, navbar, accordion, modal, offcanvas, and many more.
That's where this complete Bootstrap 5 cheat sheet comes in.
Instead of searching the internet every time, you can bookmark this guide and quickly find the Bootstrap class or component you need.
💡 My Experience
When I first started learning Bootstrap, I spent more time searching for class names than actually building websites. I could remember how a component looked, but not the exact class needed to create it.
After working on multiple web projects and teaching Bootstrap in computer labs, I created my own reference sheet containing the most commonly used classes. It saved a lot of development time and helped me understand how different Bootstrap utilities work together.
This article is designed with the same goal—to provide a practical reference that beginners can return to whenever they need it.
What is Bootstrap 5?
Bootstrap 5 is a free and open-source front-end CSS framework developed to make responsive web development easier.
It provides:
Responsive Grid System
Ready-made UI Components
Utility Classes
Flexbox Utilities
Forms
Navigation
Typography
JavaScript Components
Icons (via Bootstrap Icons)
Bootstrap 5 no longer depends on jQuery, making websites faster and easier to maintain.
Why Use Bootstrap?
Bootstrap helps you:
Build websites faster.
Create responsive layouts.
Reduce CSS writing.
Maintain consistent designs.
Support multiple screen sizes.
Develop professional interfaces quickly.
Before You Start
To use Bootstrap 5:
Basic knowledge of HTML.
Basic CSS understanding.
A code editor (such as VS Code).
Bootstrap CSS and JavaScript files (via CDN or local installation).
1. Layout Classes
| Class | Purpose |
|---|---|
container | Fixed-width container |
container-fluid | Full-width container |
container-sm | Small responsive container |
container-md | Medium container |
container-lg | Large container |
container-xl | Extra large container |
container-xxl | XXL container |
2. Grid System
| Class | Purpose |
|---|---|
row | Creates a row |
col | Auto-width column |
col-1 to col-12 | Fixed columns |
col-sm-* | Small screens |
col-md-* | Medium screens |
col-lg-* | Large screens |
col-xl-* | Extra large screens |
g-0 to g-5 | Gutters |
gx-* | Horizontal spacing |
gy-* | Vertical spacing |
3. Display Utilities
| Class |
|---|
d-none |
d-block |
d-inline |
d-inline-block |
d-flex |
d-grid |
d-table |
Responsive versions:
d-sm-*d-md-*d-lg-*d-xl-*d-xxl-*
4. Flexbox Utilities
Common classes:
d-flexflex-rowflex-columnflex-wrapjustify-content-startjustify-content-centerjustify-content-endjustify-content-betweenjustify-content-aroundalign-items-startalign-items-centeralign-items-endalign-self-centerorder-1order-last
💡 My Recommendation
Instead of memorizing every Bootstrap class, first understand the purpose of each utility category—such as layout, spacing, typography, and flexbox. Once you know what you want to achieve, remembering the class names becomes much easier.
5. Spacing Utilities
Margin:
m-0m-1m-2m-3m-4m-5
Padding:
p-0p-1p-2p-3p-4p-5
Directional spacing:
mt-*mb-*ms-*me-*mx-*my-*pt-*pb-*ps-*pe-*px-*py-*
6. Typography
Common typography classes:
h1toh6display-1todisplay-6leadfw-boldfw-normalfw-lightfst-italictext-decoration-nonetext-uppercasetext-lowercasetext-capitalizetext-break
7. Text Colors
text-primarytext-secondarytext-successtext-dangertext-warningtext-infotext-lighttext-darktext-mutedtext-white
8. Background Colors
bg-primarybg-successbg-dangerbg-warningbg-infobg-secondarybg-darkbg-lightbg-bodybg-transparent
9. Buttons
Common button classes:
btnbtn-primarybtn-secondarybtn-successbtn-dangerbtn-warningbtn-infobtn-darkbtn-lightbtn-outline-primarybtn-lgbtn-sm
10. Forms
Useful classes:
form-controlform-labelform-selectform-checkform-check-inputform-check-labelform-floatinginput-groupinput-group-textform-text
11. Tables
tabletable-stripedtable-borderedtable-hovertable-darktable-responsivetable-successtable-dangertable-warning
12. Navigation Components
Bootstrap provides ready-to-use navigation components:
Navbar
Nav
Tabs
Pills
Breadcrumb
Pagination
Common classes:
navbarnavbar-brandnavbar-navnav-itemnav-linknavbar-togglercollapsebreadcrumbpagination
13. Cards
Useful classes:
cardcard-headercard-bodycard-footercard-titlecard-textcard-img-topcard-group
14. Alerts
alertalert-primaryalert-successalert-warningalert-dangeralert-dismissible
15. Badges
badgebg-primaryrounded-pill
16. Modals
Common classes:
modalmodal-dialogmodal-contentmodal-headermodal-bodymodal-footer
17. Offcanvas
Classes:
offcanvasoffcanvas-startoffcanvas-endoffcanvas-topoffcanvas-bottomoffcanvas-headeroffcanvas-body
18. Accordion
Classes:
accordionaccordion-itemaccordion-headeraccordion-buttonaccordion-collapseaccordion-body
19. Carousel
Classes:
carouselcarousel-itemcarousel-indicatorscarousel-control-prevcarousel-control-nextcarousel-caption
20. Other Popular Components
Bootstrap also includes:
Dropdown
Collapse
Toast
Spinner
Progress Bar
List Group
ScrollSpy
Tooltip
Popover
Placeholder
Close Button
Ratio
Position Utilities
Visibility Utilities
Borders
Shadows
Rounded Corners
Together, these categories contain 300+ commonly used classes and components, making Bootstrap a powerful framework for building responsive websites.
⚠️ Note
Bootstrap provides many utility classes, but avoid using unnecessary classes on every element. Combining Bootstrap with clean, semantic HTML makes your code easier to read, maintain, and debug.
Quick Summary Table
| Category | Examples |
|---|---|
| Layout | container, row, col-* |
| Display | d-flex, d-grid |
| Flexbox | justify-content-*, align-items-* |
| Spacing | m-*, p-* |
| Typography | fw-bold, lead |
| Colors | text-*, bg-* |
| Buttons | btn-* |
| Forms | form-control, input-group |
| Tables | table, table-striped |
| Components | Navbar, Card, Modal, Carousel, Accordion, Offcanvas |
Common Beginner Mistakes
Avoid these mistakes:
Forgetting to include the Bootstrap CSS and JavaScript files.
Mixing custom CSS with Bootstrap without understanding specificity.
Ignoring the responsive grid system.
Overusing utility classes on every element.
Forgetting to test layouts on mobile devices.
Using outdated Bootstrap 4 examples in Bootstrap 5 projects.
Not learning the grid system before using advanced components.
Interesting Facts
Bootstrap was originally developed at Twitter.
Bootstrap 5 removed the dependency on jQuery.
The framework uses a mobile-first responsive design approach.
Thousands of websites and admin dashboards are built with Bootstrap.
Learning Bootstrap makes it easier to understand other modern CSS frameworks.
Best Practices
Learn the Grid System before advanced components.
Build responsive layouts from the beginning.
Use utility classes to reduce custom CSS where appropriate.
Keep Bootstrap updated to the latest stable version.
Combine Bootstrap with semantic HTML and accessibility best practices.
Conclusion
Bootstrap 5 is one of the fastest ways to build responsive, professional-looking websites. By understanding its layout system, utility classes, and reusable components, you can significantly reduce development time while maintaining clean and consistent designs.
Rather than memorizing every class, focus on understanding the purpose of each category. With regular practice, you'll naturally remember the most commonly used classes and become much more productive in your web development projects.
Frequently Asked Questions (FAQs)
1. What is Bootstrap 5?
Bootstrap 5 is a free, open-source front-end framework used to create responsive and mobile-friendly websites quickly.
2. Do I need to know CSS before learning Bootstrap?
Yes. Basic knowledge of HTML and CSS will help you understand how Bootstrap classes work and when to use them.
3. Does Bootstrap 5 require jQuery?
No. Bootstrap 5 removed its dependency on jQuery and uses modern JavaScript instead.
4. What is the Bootstrap Grid System?
The Grid System is a responsive layout system based on rows and columns that adapts to different screen sizes.
5. Are Bootstrap classes responsive?
Many Bootstrap classes include responsive variants for different screen sizes, allowing layouts to adjust automatically.
6. Can I customize Bootstrap?
Yes. You can customize Bootstrap using your own CSS or by modifying its Sass source files.
7. Is Bootstrap still worth learning in 2026?
Absolutely. Bootstrap remains one of the most widely used CSS frameworks for beginners, professionals, rapid prototyping, and responsive web development.
⚠️ If the above link is not working, downloading slowly, or showing any error, please use our high-speed backup link below:
⚡ Alternative Download Link (MirrorAd)