10 Program to demonstrate Buttons in BootStrap

Program:

<!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"

        integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">

    <!-- CSS only -->

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"

        integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">



    <!-- JS, Popper.js, and jQuery -->

    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"

        integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous">

    </script>

    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"

        integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous">

    </script>

    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"

        integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous">

    </script>

    <title>Buttons in Bootstrap4</title>

</head>



<body>



    <nav class="navbar navbar-expand-sm navbar-dark bg-success">

        <a class="navbar-brand" href="#">Buttons in Bootstrap4</a>

        <button class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav">

            <span class="navbar-toggler-icon"></span>

        </button>

    </nav>



    <div class="container mt-5">

        <!--########################START HERE#########################-->



        <!-- BUTTONS -->

        <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-info">Info</button>

        <button type="button" class="btn btn-warning">Warning</button>

        <button type="button" class="btn btn-danger">Danger</button>

        <button type="button" class="btn btn-link">Link</button>



        <hr>



        <!-- BUTTON TAGS -->

        <a href="#" role="button" class="btn btn-primary">Link</a>

        <button type="submit" class="btn btn-primary">Button</button>

        <input type="button" value="Input" class="btn btn-primary">

        <input type="submit" value="Submit" class="btn btn-primary">

        <input type="reset" value="Reset" class="btn btn-primary">



        <hr>



        <!-- OUTLINE BUTTONS -->

        <button type="button" class="btn btn-outline-primary">Primary</button>

        <button type="button" class="btn btn-outline-secondary">Secondary</button>

        <button type="button" class="btn btn-outline-success">Success</button>

        <button type="button" class="btn btn-outline-danger">Danger</button>

        <button type="button" class="btn btn-outline-warning">Warning</button>

        <button type="button" class="btn btn-outline-info">Info</button>

        <button type="button" class="btn btn-outline-light text-dark">Light</button>

        <button type="button" class="btn btn-outline-dark">Dark</button>



        <hr>



        <!-- BUTTON SIZES -->

        <button type="button" class="btn btn-primary btn-lg"><i class="fa fa-user"></i> Large button</button>

        <button type="button" class="btn btn-primary btn-sm">Small button</button>

        <hr>

        <button type="button" class="btn btn-primary btn-lg btn-block">Block level button</button>



        <hr>



        <!-- SPLIT DROPDOWNS btn-group-->

        <div class="btn-group">

            <button type="button" class="btn btn-secondary">My Button</button>

            <button class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"

                aria-expanded="false">

                <span>Toggle Dropdown</span>

            </button>

            <div class="dropdown-menu">

                <a href="#" class="dropdown-item">Link One</a>

                <a href="#" class="dropdown-item">Link Two</a>

                <a href="#" class="dropdown-item">Link Three</a>

                <div class="dropdown-divider"></div>

                <a href="#" class="dropdown-item">Link Four</a>

            </div>

        </div>



        <hr>



        <!-- BUTTON GROUPS -->

        <div class="btn-group" role="group" aria-label="Basic example">

            <button type="button" class="btn btn-success btn-outline-danger">Left</button>

            <button type="button" class="btn btn-success btn-outline-danger">Middle</button>

            <button type="button" class="btn btn-success btn-outline-danger">Right</button>

        </div>



        <hr>



        <!-- BUTTON TOOLBAR -->



        <div class="btn-toolbar" role="toolbar" aria-label="Button Toolbar">

            <div class="btn-group" role="group" aria-label="First Group">

                <button type="button" class="btn btn-info">1</button>

                <button type="button" class="btn btn-info">2</button>

                <button type="button" class="btn btn-info">3</button>

                <button type="button" class="btn btn-info">4</button>

            </div>

            <div class="btn-group" role="group" aria-label="Second Group">

                <button type="button" class="btn btn-danger">5</button>

                <button type="button" class="btn btn-danger">6</button>

                <button type="button" class="btn btn-danger">7</button>

            </div>

            <div class="btn-group" role="group" aria-label="Third Group">

                <button type="button"  class="btn btn-info">8</button>

            </div>

        </div>





    </div><!-- ./container -->

    <div style="margin-top:500px;"></div>



    <!-- BODY ENDS -->

</body>



</html>


Output:

Buttons in BootStrap

Previous
Next Post »