YouTip LogoYouTip

Bootstrap Progress Bars

This chapter will explain Bootstrap progress bars. In this tutorial, you will see how to use Bootstrap to create progress bars for loading, redirecting, or action states. > !(#)Bootstrap progress bars use CSS3 transitions and animations to achieve this effect. Internet Explorer 9 and earlier versions and older versions of Firefox do not support this feature, and Opera 12 does not support animations. ## Default Progress Bar The steps to create a basic progress bar are as follows: * Add a
with the class **.progress**. * Then, inside the above
, add an empty
with the class **.progress-bar**. * Add a style attribute with a width represented as a percentage, for example, style="width: 60%"; this indicates the progress bar is at the 60% position. Let's look at the example below. The .sr-only class can hide the text content: ## Example
40% Complete
[Try it Β»](#) The result is as follows: ![Image 2: Progress Bar](#) You can also set text content within the progress bar: ## Example
70%
[Try it Β»](#) The result is as follows: ![Image 3: Progress Bar](#) ## Alternate Progress Bars The steps to create progress bars with different styles are as follows: * Add a
with the class **.progress**. * Then, inside the above
, add an empty
with the class **.progress-bar** and the class **progress-bar-***. Here, * can be **success, info, warning, danger**. * Add a style attribute with a width represented as a percentage, for example, style="60%"; this indicates the progress bar is at the 60% position. Let's look at the example below: ## Example
90% Complete (success)
30% Complete (info)
20% Complete (warning)
10% Complete (danger)
[Try it Β»](#) The result is as follows: ![Image 4: Alternate Progress Bars](#) Displaying progress bar text content: ## Example
40% Complete (success)
50% Complete (info)
60% Complete (warning)
70% Complete (danger)
[Try it Β»](#) The result is as follows: ![Image 5: Alternate Progress Bars](#) ## Striped Progress Bars The steps to create a striped progress bar are as follows: * Add a
with the class **.progress** and **.progress-striped**. * Then, inside the above
, add an empty
with the class **.progress-bar** and the class **progress-bar-***. Here, * can be **success, info, warning, danger**. * Add a style attribute with a width represented as a percentage, for example, style="60%"; this indicates the progress bar is at the 60% position. Let's look at the example below: ## Example
90% Complete (success)
30% Complete (info)
20% Complete (warning)
10% Complete (danger)
[Try it Β»](#) The result is as follows: ![Image 6: Striped Progress Bars](#) ## Animated Progress Bars The steps to create an animated progress bar are as follows: * Add a
with the class **.progress** and **.progress-striped**. Also add the class **.active**. * Then, inside the above
, add an empty
with the class **.progress-bar**. * Add a style attribute with a width represented as a percentage, for example, style="60%"; this indicates the progress bar is at the 60% position. This will give the stripes a sense of movement from right to left. Let's look at the example below: ## Example
40% Complete
[Try it Β»](#) The result is as follows: ![Image 7: Animated Progress Bars](#) ## Stacked Progress Bars You can even stack multiple progress bars. To stack multiple progress bars, place them within the same **.progress**, as shown in the example below: ## Example
40% Complete
30% Complete (info)
20% Complete (warning)
[Try it Β»](#) The result is as follows: ![Image 8: Stacked Progress Bars](#) * * * ## Progress Bar Size We can set the size of the progress bar using the height property: ## Example
[Try it Β»](#) The result is as follows: ![Image 9: Progress Bar Size](#)
← Bootstrap Media ObjectBootstrap Alerts β†’

YouTip © 2024-2026 | Home | Learn Technology, Build Dreams!

All content is for educational and learning purposes only.