LESSON 10.3
Getting Started with Bootstrap
Install the most popular CSS framework in two lines
Learn how to install Bootstrap on your website so you can start to use all the Bootstrap tools.
💡 The Concept
Getting started with Bootstrap takes just two lines in your HTML, and your project immediately has access to a full design system. Bootstrap is a free CSS and JavaScript framework originally built by the Twitter team. It gives you a complete system for building responsive, mobile-first websites without writing all the CSS yourself. You get a powerful grid for columns, pre-styled buttons and forms, a hamburger navigation, modals, and much more.
Grid System
Grid systems are the magic of a responsive Internet. They create vertical columns and horizontal rows that define the spacing, alignment, and positioning of content. The key benefit is that they stack on mobile, which allows web designers to design full-width websites that also look good on a smartphone. You can see the magic of a grid system in the graphic below:

We’ll learn how to use Bootstrap columns in the next lesson. But before we can do that, we need to install Bootstrap.
Installing Bootstrap
Bootstrap 5 needs two things: a CSS file in your <head> and a JavaScript file before your closing </body> tag.
In the <head>, above your own stylesheet:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
Before </body>:
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
That is it, just two lines. Bootstrap 5 no longer requires jQuery or any other separate files.
Exercise: Try It Yourself
Step 1. Add the Bootstrap CSS CDN link to your website, above your own stylesheet. Double-check that your own stylesheet comes after the Bootstrap link.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
Step 2. Add the Bootstrap JS CDN link just before the closing </body> tag.
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
Step 3. Check your website. We haven’t used any Bootstrap classes yet, but you may see some minor changes to your default CSS.
Your website <head>should look something like this. The key is that your stylesheet is below the Bootstrap stylesheet.

This is the correct placement for the Bootstrap script tag:

💡 If you are making a website template: Add the Bootstrap CDN links to your website template. See the full website template guide for reference.
❓ Frequently Asked Questions
Quite a lot. Beyond the responsive grid and the styling, Bootstrap ships with ready-made components you can drop straight into your page, including styled forms, buttons, modals, a mobile hamburger navigation, and accordions. You build these with simple classes instead of writing the CSS and JavaScript yourself. You can see these components in action in the <a href=”https://webdevstudents.com/lessons/what-else-can-bootstrap-do/”>What Else Can Bootstrap Do?</a> lesson.
Yes, and you will want to. Bootstrap gives you a solid starting point with its grid, buttons, forms, and other components, but it does not know your colors, fonts, or brand. You add your own stylesheet after the Bootstrap link so your custom rules load last and can override or extend the defaults. Most real projects use Bootstrap for structure and layout, then layer their own CSS on top to make the site feel unique.
They do different jobs. The CSS file holds all the styling and layout rules, which is the grid, the spacing, the colors, and the look of buttons and forms. The JavaScript file powers the interactive components such as dropdown menus, the mobile hamburger navigation, modals, and carousels. The CSS goes in the head so styles load early, and the script goes just before the closing body tag so the page content loads first.
No. The grid system, spacing, colors, buttons, and most utility classes are pure CSS, so they work with just the stylesheet link. You only need the JavaScript bundle when you use interactive components like the collapsing navbar, dropdowns, modals, tabs, or carousels. It is common to include it anyway so everything is ready when you reach for those pieces later.
No. Older versions of Bootstrap relied on jQuery, but Bootstrap 5 was rewritten to use plain JavaScript, so jQuery is no longer required. The single bundle file you link before the closing body tag includes everything the components need. This is one reason Bootstrap 5 is lighter and a little faster than earlier versions.
Yes, a little. Bootstrap includes a reset called Reboot that normalizes default browser styles, so even before you use a single Bootstrap class you may notice changes to fonts, spacing, headings, and link colors. This is expected, and it gives every Bootstrap project a clean, consistent baseline to build on. As you add your own stylesheet and Bootstrap classes, you take full control of the look from there.
★ Key Takeaways
Bootstrap is one of the most popular front-end frameworks in the world. This lesson showed you how to link Bootstrap to a project and start using its built-in styles and components. Next, you will learn about Bootstrap columns, which are the backbone of Bootstrap’s layout system. Columns let you create responsive multi-column layouts with very little code.
Google Ads
The costs of this website are partially offset by revenue from Google Ads.Tools of the Trade
HTML/CSS Lessons
-
-
-
1.3. HTML Tag Preview
-
-
-
2.2. The HTML Framework
-
-
2.4. HTML Headings
-
-
-
-
-
-
3.01. Introduction to CSS
-
3.02. How CSS Cascades
-
-
-
-
3.05. CSS Colors
-
3.06. RGBA Colors
-
-
3.08. Font and Text Properties
-
3.09. Classes and IDs
-
-
-
-
-
4.3. HTML Embedded Images
-
-
-
-
-
-
5.1. CSS Borders
-
5.2. CSS Border Radius
-
5.3. CSS Gradients
-
5.4. CSS Box Shadows
-
5.5. CSS Text Shadows
-
7.1. The Display Property
-
-
-
7.4. The Box Model
-
-
-
-
-
-
9.1. Website Tables
-
9.2. HTML Forms
-
-
9.4. Special Form Fields
-
9.5. Embedding Multimedia
-
-
9.7. Keyboard Shortcuts
-
10.1. What Is a Framework?
-
10.2. Font Awesome Icons
-
-
10.4. Bootstrap Grid System
-
-
10.6. Bootstrap Navigation
-
-
11.2. Purchasing a Domain Name
-
11.3. Website Hosting
-
11.4. Nameservers and DNS
-
11.5. FTP
-
11.6. GitHub Pages
