HTML CSS Bootstrap JavaScript jQuery MySQL PHP Data Mining

Bootstrap Introduction

Written by RedoHub Team · Last updated: August 1, 2026

Bootstrap is the world's most popular open-source CSS framework. It provides a collection of ready-made components, a powerful grid system, and helpful utility classes that let you build responsive, mobile-first websites quickly and consistently — without writing a lot of custom CSS from scratch.


What is Bootstrap?

  • Bootstrap is a free, open-source front-end framework
  • Originally created by Twitter developers in 2011
  • It includes HTML, CSS, and JavaScript-based design templates
  • It is built around a 12-column responsive grid system
  • Bootstrap 5 is the latest major version (no jQuery dependency)

Why Use Bootstrap?

Building a website from scratch requires a lot of effort. Bootstrap solves common problems by giving you:

  • Responsive layout — pages automatically adjust for phones, tablets, and desktops
  • Pre-styled components — buttons, cards, modals, navbars, and more, ready to use
  • Cross-browser consistency — looks the same in Chrome, Firefox, Edge, and Safari
  • Faster development — less custom CSS to write
  • Strong community — huge ecosystem of themes, plugins, and documentation

Bootstrap vs Plain CSS

Feature Plain CSS Bootstrap
Responsive grid Write manually Built-in (12-col grid)
UI Components Build from scratch Ready-to-use
JavaScript widgets Needs custom JS Included (modals, dropdowns…)
Learning curve Low (just CSS) Low (class-based)
File size Minimal Larger (CDN makes it fast)

How to Add Bootstrap to Your Page

The easiest way to get started is to include Bootstrap from a CDN (Content Delivery Network) — no download required.

Step 1 — Add the CSS in <head>

Paste this <link> tag inside your HTML <head> section:

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

Step 2 — Add the JS before </body>

Paste this <script> tag just before the closing </body> tag to enable interactive components like modals and dropdowns:

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

Step 3 — A Minimal Bootstrap Page

Here is a complete, working Bootstrap starter template:

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

    <div class="container">
        <h1 class="text-primary mt-4">Hello, Bootstrap!</h1>
        <p class="lead">This is my first Bootstrap page.</p>
        <button class="btn btn-success">Click Me</button>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Note: The meta name="viewport" tag is required for Bootstrap's responsive behaviour to work correctly on mobile devices.

Key Bootstrap Concepts at a Glance

Concept Description Example Class
Container Centers and constrains your page content container, container-fluid
Grid 12-column layout system using rows and columns row, col-md-6
Components Ready-made UI elements btn, card, navbar
Utilities Helper classes for spacing, color, text, etc. mt-3, text-center, bg-dark
Breakpoints Screen size targets for responsive design sm, md, lg, xl

Key Points to Remember

  • Bootstrap is class-based — you style elements by adding predefined class names
  • Always include the viewport meta tag for responsive behaviour
  • Bootstrap 5 does NOT require jQuery — it uses vanilla JavaScript
  • The CDN approach is the fastest way to start — no installation needed
  • You can customise Bootstrap by overriding its CSS with your own stylesheet

Common Mistakes to Avoid

Forgetting the viewport meta tag. Without <meta name="viewport" content="width=device-width, initial-scale=1.0">, Bootstrap's responsive grid and utilities won't behave correctly on real mobile devices, even though desktop looks fine.
Loading the Bootstrap JS bundle before your own custom scripts that use it. Any script relying on Bootstrap's JavaScript components (modals, dropdowns) must load after the bundle, not before.
Fighting Bootstrap's default styles with !important overrides everywhere. A large pile of !important rules usually means the grid or utility classes weren't used correctly in the first place — check for a built-in class before reaching for custom CSS.

Try It: A Two-Column Layout with a Component

A second example — combining the grid system with a ready-made component to build a simple two-column page section:

<div class="container">
    <div class="row">
        <div class="col-md-8">
            <h2>Main Content</h2>
            <p>This column takes up 8 of 12 grid units on medium screens and up.</p>
        </div>
        <div class="col-md-4">
            <div class="card p-3">
                <strong>Sidebar</strong>
                <p class="mb-0">A Bootstrap card component filling the remaining 4 units.</p>
            </div>
        </div>
    </div>
</div>

Frequently Asked Questions

Q: Do I need to know JavaScript to use Bootstrap?

A: No — most of Bootstrap is CSS classes you apply directly to HTML. JavaScript is only needed for interactive components like modals, dropdowns, and carousels, and Bootstrap ships that JS for you.

Q: Is Bootstrap still relevant with Tailwind CSS around?

A: Yes — they solve similar problems differently. Bootstrap ships pre-styled components out of the box; Tailwind gives you low-level utility classes to build your own look. Both remain widely used.

Q: Where can I see every available Bootstrap class?

A: The official Bootstrap 5 documentation covers every component and utility with live examples.