Getting Started

Bootstrap Introduction

Get started with Bootstrap — the world's most popular CSS framework for responsive, mobile-first sites.

What is Bootstrap?

Bootstrap is a free, open-source CSS framework for building responsive, mobile-first websites. It includes pre-built components, a grid system, and utilities that let you prototype and build quickly.

Bootstrap 5

This tutorial covers Bootstrap 5, the latest major version. Key improvements over Bootstrap 4:

  • Dropped jQuery dependency (pure vanilla JavaScript)
  • New utility API
  • Improved grid system
  • Updated components
  • Better customization with CSS custom properties

Including Bootstrap

CDN (quickest way):

html
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>

npm:

bash
npm install bootstrap

Example

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Bootstrap 5</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

  <div class="container mt-5">
    <h1 class="text-primary">Hello, Bootstrap!</h1>
    <p class="lead">Bootstrap makes responsive design easy.</p>

    <button class="btn btn-primary">Primary Button</button>
    <button class="btn btn-secondary ms-2">Secondary</button>
    <button class="btn btn-outline-danger ms-2">Danger</button>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Try it yourself — HTML