Cheatsheets Bootstrap Cheatsheet Use this Bootstrap cheatsheet to remember grid syntax, spacing utilities, buttons, cards, alerts, forms and navbars, plus the markup patterns that require Bootstrap CSS in your project.
Quick reference Grid Container container
Row row
Column col-md-6
Gap g-3
Spacing Margin top mt-4
Padding p-3
Horizontal margin mx-auto
Responsive spacing py-3 py-md-5
Components Button btn btn-primary
Card card card-body
Alert alert alert-success
Form input form-control
<div class="container">
<div class="row g-3">
<div class="col-md-4">Column 1</div>
<div class="col-md-4">Column 2</div>
<div class="col-md-4">Column 3</div>
</div>
</div>Bootstrap classes require Bootstrap CSS in your project.
Live preview
Columns: 3
col col col
<button class="btn btn-primary">primary</button>
<button class="btn btn-outline-primary">Outline</button>Bootstrap classes require Bootstrap CSS in your project.
Live preview
Variantprimary success warning
primary Outline
<div class="alert alert-primary">primary alert</div>
<div class="card">
<div class="card-body">Card body text.</div>
</div>Bootstrap classes require Bootstrap CSS in your project.
Live preview
Variantprimary success warning
primary alert Card title Card body text.
<label class="form-label" for="email">Email address</label>
<input id="email" class="form-control" type="email">
<button class="btn btn-primary">Submit</button>Bootstrap classes require Bootstrap CSS in your project.
Live preview
Variantprimary success warning Sizesmall normal large
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="#">Brand</a>
<button class="navbar-toggler">Menu</button>
</nav>Bootstrap classes require Bootstrap CSS in your project.
Live preview
Expand on desktop
Brand Docs Pricing Menu
When to use Use Bootstrap when you want established components and grid conventions. Use grid classes for fast responsive page structure. Use component classes when Bootstrap CSS is already in the project. Quick tips Keep columns inside rows and rows inside containers. Use responsive column classes to stack on mobile. Copy Bootstrap markup together with the required classes. Common mistakes Using column classes outside a row. Expecting Bootstrap markup to style itself without Bootstrap CSS. Overriding too many Bootstrap rules instead of choosing simpler markup. Best practices Use Bootstrap utilities for spacing before custom CSS. Keep labels on form controls for accessibility. Prefer standard component patterns when speed matters. Examples <div class="container py-5">
<div class="row g-4">
<div class="col-md-6">First</div>
<div class="col-md-6">Second</div>
</div>
</div>Common mistakes and tips Bootstrap grid columns must sit inside a row. Use responsive classes like col-md-6 to stack on mobile and split on larger screens. Avoid mixing too many custom layout rules with Bootstrap grid utilities. Bootstrap FAQ What is included in the Bootstrap cheatsheet? Bootstrap Cheatsheet includes quick reference sections, practical examples, common mistakes, tips and links to related DevKitYard tools.
Is the Bootstrap cheatsheet interactive? Yes. This cheatsheet includes visual examples with copyable code and lightweight controls where interaction helps explain the pattern.
When should I use this Bootstrap reference? Use it when you need to recall syntax, compare common patterns or avoid mistakes without opening a long tutorial.
What should I use after reading this cheatsheet? Use related DevKitYard tools such as HTML Formatter, CSS Beautifier when you need to format, validate, generate or inspect real output.