Bootstrap is the most widely used open-source CSS framework for building responsive, mobile-first websites. Originally created at Twitter in 2011, it now powers millions of sites because it lets you assemble polished layouts with ready-made classes instead of writing every style by hand. In this first lesson you will learn what Bootstrap actually is, why teams still choose it in the age of utility frameworks, and how to set up Bootstrap 5 in a project in under five minutes.
Bootstrap ships three main things: a responsive grid system, a large library of pre-styled components (buttons, navbars, cards, modals and more), and hundreds of utility classes for spacing, color, display and alignment. Because Bootstrap 5 dropped the jQuery dependency, its JavaScript components now run on plain vanilla JS, which keeps your pages lighter and easier to integrate with React, Vue or no framework at all.
Key reasons developers pick Bootstrap:
The quickest way to try Bootstrap is loading it from a CDN. Add one stylesheet link in the head and one script bundle before the closing body tag:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My First Bootstrap Page</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container py-5">
<h1 class="text-primary">Hello, Bootstrap!</h1>
<button class="btn btn-success">It works</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>The bootstrap.bundle.min.js file includes Popper.js, which tooltips, dropdowns and popovers need, so you do not have to load it separately.
When you use a build tool such as Vite or webpack, install Bootstrap as a dependency so you can customize it later with Sass:
npm install bootstrap@5.3.3Then import it in your entry JavaScript or Sass file:
import "bootstrap/dist/css/bootstrap.min.css";
import "bootstrap";Bootstrap is mobile-first, meaning its styles are written for small screens first and enhanced for larger ones. For that to work on phones, the viewport meta tag shown above is required. Without it, mobile browsers render the page at desktop width and then shrink it, breaking every responsive behavior.
Open the example page in a browser. If the heading renders in Bootstrap blue and the button appears green with rounded corners, the CSS loaded correctly. To confirm JavaScript works, add a data-bs-toggle component such as a dropdown later in this course and check that it opens on click.
Next up: Containers and the Grid System, where you will learn how Bootstrap structures every layout.