Tutorials

Bootstrap tutorials

Bootstrap

What Is Bootstrap and Why Use It?

3 min read · 67 views

Bootstrap is a free, open-source toolkit for building websites quickly, providing ready-made styles and interactive components so a page can look polished without writing every rule of CSS from scratch.

The problem it solves

Making a website look good and work correctly across phones, tablets and desktops takes a large amount of careful CSS, along with cross-browser testing most teams do not have time for on every single project. Bootstrap has already solved that problem once, thoroughly, and packaged the result as reusable classes that any project can apply immediately.

What Bootstrap actually gives you

  • A responsive grid system for arranging content into rows and columns that adapt to screen size.
  • Pre-styled components such as buttons, forms, cards, navigation bars and modals.
  • A large set of utility classes for spacing, colour, text alignment and layout, avoiding the need for custom CSS for small adjustments.
  • Sensible, consistent typography and visual defaults applied automatically across the whole page.

Adding Bootstrap to a page

The fastest way to start is linking it directly from a CDN inside the page head, with no installation step required:

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

From that point, styling an element is as simple as adding the right class name:

<button class="btn btn-primary">Click me</button>

Customising instead of fighting the defaults

Rather than overriding Bootstrap's compiled CSS with increasingly specific custom rules, a cleaner long-term approach is compiling Bootstrap from its own Sass source and changing the variables it exposes, such as colours and spacing, before the build runs. This keeps a project's visual identity organised in one place and much easier to maintain as Bootstrap itself is updated over time.

Is it the right choice?

Bootstrap is an excellent fit when a clean, responsive, professional-looking site needs to be built quickly, which describes the large majority of business sites, admin panels and internal tools. For a highly distinctive, brand-driven design, more custom CSS is usually still written on top, but even then Bootstrap remains a solid, well-tested foundation to build from rather than starting completely from nothing.

A note on alternatives

Other approaches exist, such as utility-first frameworks that provide only small building-block classes with no pre-styled components, or writing all CSS by hand. Bootstrap sits closer to the component-focused end of that spectrum, which is exactly why it tends to get a working, good-looking page finished faster, at the cost of slightly more effort later if a site needs to look truly unlike every other Bootstrap site.