Bootstrap Progress Bars

Learn how to create a ProgressBar on a web page with Bootstrap. With that, get a thorough understanding of the following in this lesson:

  • Set the width of ProgressBar
  • Set the height of ProgressBar
  • Add stripes to ProgressBar
  • Change the color of ProgressBar
  • Animate ProgressBar

To create a Progress Bar, use the Bootstrap classes .progress and .progress-bar classes. With that, we can use the Bootstrap classes to work on Progress Bars:

  • Set the width of a Progress Bar with the width property.
  • Set the height of a Progress Bar with the height property.
  • To add stripes to a Progress Bar, use the .progress-bar-striped class

Use the Bootstrap contextual background classes to change the color of the Progress Bar:

  • .progress-bar-success
  • .progress-bar-info
  • .progress-bar-warning
  • .progress-bar-danger

To animate a Progress Bar, use the .progress-bar-animated class.

Example – Bootstrap Progress Bars

Let us now see an example to create Progress Bars in Bootstrap:

<!DOCTYPE html>
<html lang="en">
   <head>
      <title>Bootstrap Progress Bars Example</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" rel="stylesheet">
      <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
   </head>
   <body>
      <div class="container">
         <h2>Level of Water in the Cave</h2>
         <div class="progress" style="height: 25px;">
            <div class="progress-bar"
               style="width:90%;height: 25px;"> </div>
         </div>
      </div>
   </body>
</html>

Output

Bootstrap Progress Bar

Video Tutorial – Bootstrap Progress Bars

The following is the complete video tutorial to learn how to work with Progress Bars in Bootstrap:


If you liked the tutorial, spread the word and share the link and our website Studyopedia with others:


Read More:

Bootstrap Badges
Bootstrap Navbar
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment