Introduction
Bootstrap is a CSS (and small amount of JavaScript) framework that ships a full design system in one file: a responsive grid, pre-styled versions of nearly every common UI element, and a huge set of utility classes for the small stuff. You write HTML with Bootstrap's class names, and the styling comes along for free.
Adding Bootstrap to a page
The fastest way to try Bootstrap is a CDN link in the <head> — no build tools, no install step:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>Hello, Bootstrap</h1>
<p>This paragraph is already using Bootstrap's default typography.</p>
</div>
</body>
</html>
The <link> tag pulls in Bootstrap's compiled CSS from a CDN. Some components (like the modal you'll see in lesson 9) also need Bootstrap's JavaScript bundle, added as a <script> tag near the end of <body> — you'll see that when it's actually needed.
The container class
Almost every Bootstrap page wraps its content in an element with the container class. It centers your content and adds sensible side padding and a max-width that adjusts at different screen sizes, instead of letting text and components stretch edge-to-edge on a wide monitor:
<div class="container"> <h1>Welcome</h1> <p>Content stays comfortably centered, with padding on either side.</p> </div>
There's also container-fluid, which always spans 100% of the viewport width at every screen size, with no max-width cap — useful for a full-bleed header or a layout that should never leave empty space on the sides.
<meta name="viewport" content="width=device-width, initial-scale=1"> — being present in <head>. Without it, mobile browsers render the page at a fixed desktop-width viewport and then zoom out, which silently breaks every responsive class you write in the rest of this course. It's easy to forget and hard to notice until you test on an actual phone.