Topic 3 ยท Bootstrap Framework โ Your introduction to the world's most popular CSS framework
Bootstrap is a free, open-source CSS framework that lets you build responsive, mobile-first websites fast. Instead of writing every CSS rule yourself, you use Bootstrap's pre-built classes for layouts, buttons, forms, navigation, and more.
Two ways to get Bootstrap into your project. The CDN method is fastest:
Add these two lines to your HTML โ one in <head>, one before </body>:
<!-- in <head> -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- before </body> -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
Download Bootstrap from getbootstrap.com, unzip, and link the local files. Useful when you need to work offline.
The grid is how Bootstrap structures every layout. Three building blocks:
<div class="container">
<div class="row">
<div class="col-md-6">Left half</div>
<div class="col-md-6">Right half</div>
</div>
</div>
The number after col- tells Bootstrap when to apply that width. Bootstrap has 5 breakpoint sizes:
xs โ extra small (phones, < 576px) โ implicit, no prefixsm โ small (โฅ 576px)md โ medium (โฅ 768px, tablets)lg โ large (โฅ 992px, laptops)xl โ extra large (โฅ 1200px, desktops)See the Bootstrap Breakpoints reference (PDF) for the full chart.
Utilities are tiny single-purpose classes you stack to get exactly the look you want. Some essentials:
m-3, p-2, mt-4 (margin/padding)d-none, d-flex, d-md-blockjustify-content-between, align-items-centerfs-3, fw-bold, text-centerbg-primary, text-lightd-md-none (hide on tablet+)Bootstrap's default look is great for prototyping but every real project should be customised. You can:
<head>aria-label, alt text)Over the next few classes you'll build a complete Bootstrap site โ Skywings, a luxury resort website. You'll use the grid, navbars, cards, carousels, and forms to build something that looks professional and works on every screen size.
Class 9 โ Equinim College ยท Front End Web Development ยท 26B