Bootstrap Integration Techniques

Bootstrap can be integrated into our project either through CDN links or by using package managers like npm.

Method 1: Using Bootstrap 5 CDN

You can import Bootstrap 5 from a CDN (Content Delivery Network). You can get CDN support for Bootstrap’s CSS and JavaScript.

<!-- Compiled CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>

Method 2: Using Bootstrap 5 NPM

You can also get Bootstrap 5 via NPM(Node Package Manager).

npm install bootstrap

Example 2: Here is an example to illustrate Bootstrap 5 styling including, colors, text-color, and buttons.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        Bootstrap 5 | Buttons
    </title>
    <!-- Load Bootstrap -->
    <link rel="stylesheet" href=
"https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
          integrity=
"sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" 
          crossorigin="anonymous">
</head>

<body>
    <div style="text-align: center;width: 600px;"></div>
    <div style="width: 600px; height: 200px;
                margin:20px;text-align: center;">
        <button type="button" class="btn btn-primary">
            Primary
        </button>
        <button type="button" class="btn btn-secondary">
            Secondary
        </button>
        <button type="button" class="btn btn-success">
            Success
        </button>
        <button type="button" class="btn btn-danger">
            Danger
        </button>
        <button type="button" class="btn btn-warning">
            Warning
        </button>
    </div>
</body>

</html>

Output:

Output

What is Bootstrap ?

Bootstrap is one of the popular front-end frameworks which has a nice set of predefined CSS codes. The updated version of Bootstrap5 was officially released on 16 June 2020. Bootstrap is a CSS framework that makes mobile-friendly web development and provides responsiveness.

The framework is available for free and can be utilized in two ways either by downloading the zip files and incorporating Bootstrap libraries/modules into the project or by directly including the Bootstrap URL and using the online version.

Similar Reads

Bootstrap QuickStart

...

Features of Bootstrap

Bootstrap is the Fastest and Easiest way to create web pages.Bootstrap is widely used to create Platform-independent web pages.Bootstrap is popular for creating Responsive web pages....

Reasons to learn Bootstrap?

Using pre-styled components makes development faster.Bootstrap is based on the mobile-first concept that works well on all screen sizes.Bootstrap makes it easy to Use the grid system for a well-organized and responsive page layout without complex coding.Bootstrap offers pre-built components and styles, making projects faster to complete....

Bootstrap Components

The table below illustrates the Bootstrap Components....

Bootstrap Integration Techniques

Bootstrap can be integrated into our project either through CDN links or by using package managers like npm....

Advantages and Disadvantages

Advantages...

Contact Us