agyanadda@gmail.com

Bootstrap Get Started

Bootstrap Basics 1 min read Updated Dec 1, 2026 Topic 2 of 32

There are two common ways to add Bootstrap 5.

1. CDN (quickest)

Add the CSS in the <head>:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">

Add the JavaScript bundle before </body> (needed for navbar toggles, modals, dropdowns, carousels):

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>

The bundle already includes Popper, which dropdowns and tooltips need.

2. npm (for build tools)

npm install bootstrap and import it in your project. Useful when you want to customise Sass variables.

Do not forget the viewport tag

<meta name="viewport" content="width=device-width, initial-scale=1"> — without it, the page will not be responsive on phones.

Your own CSS

Link your style.css after Bootstrap, so your rules can override it.

Example

Example — Bootstrap 5 starter template HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Bootstrap Starter</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
  <div class="container mt-4">
    <h1>My Bootstrap Page</h1>
    <p>Start building here.</p>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

Save this as a template and start every new Bootstrap page from it.

Try it Now »

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which file includes Popper together with Bootstrap JavaScript?

Exercise 2 True / False

Your own stylesheet should be linked after Bootstrap to override it.

Exercise 3 Fill in the Blank

The meta ___ tag is required for responsive pages on phones.

Frequently Asked Questions

Only for interactive components such as navbar toggler, dropdowns, modals, carousels, tooltips and accordions. Pure layout and styling need only the CSS.