Published Jun 26, 2021Updated Oct 14, 2022
Contribute to Docs

Bootstrap is an open-source CSS framework created to help style web pages with mobile-first considerations in mind. It was created internally at Twitter in 2011 as a way to solve issues with design consistency across their engineering team. Since its creation, Bootstrap has become one of the most commonly used tools on web pages today.

Bootstrap utilizes web technologies like HTML, CSS, and JavaScript to provide aesthetic improvements to the Document Object Model (DOM) elements on a web page. Additional user interface elements such as dialog boxes, tooltips, and carousels are also available to users.


There are several ways to install Bootstrap and its source files.

For JavaScript, Bootstrap can be used with a package manager like npm or Yarn:

## npm
npm install bootstrap
## yarn
yarn add bootstrap

For Ruby applications, it can be installed as a gem with a dependency tool like Bundler:

gem 'bootstrap', '~> 5.0.2'

Another way to install Bootstrap for Ruby, but without a tool like Bundler, is with the following command:

gem install bootstrap -v 5.0.2

Instead of being downloaded, Bootstrap’s source files can be linked directly into an HTML file via CDN:

href="[email protected]/dist/css/bootstrap.min.css"
src="[email protected]/dist/js/bootstrap.bundle.min.js"


As its popularity grew, people started creating templates based on Bootstrap in order to accelerate the web development process even further. There are many websites out there dedicated to sharing and buying custom templates based on Bootstrap.

Here are the official themes built or reviewed by Bootstrap’s creators:

Example: Normal Button vs Bootstrap Button

In the example below, Bootstrap is linked into an HTML document via CDN and used with jQuery to provide a button for positive actions.

<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src=""></script>
<script src=""></script>
<div class="container">
<p>The .btn-success class indicates a successful or positive action:</p>
<button type="button" class="btn btn-success">
Bootstrap Styled Button
<button type="button">Normal Button</button>

All contributors

Looking to contribute?

Learn Open Source on Codecademy