0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/docs/components/progress.md

3.5 KiB

layout title description group
docs Progress Documentation and examples for using Bootstrap progress bars. components

Stylize the HTML5 <progress> element with a few extra classes and some crafty browser-specific CSS. Be sure to read up on the browser support.

Contents

  • Will be replaced with the ToC, excluding the "Contents" header {:toc}

Example

To caption a progress bar, simply add a <div> with your caption text, [align the text using a utility class]({{ site.baseurl }}/utilities/typography/#text-alignment), and associate the caption with the <progress> element using the aria-describedby attribute.

{% example html %}

Reticulating splines… 0%
Reticulating splines… 25%
Reticulating splines… 50%
Reticulating splines… 75%
Reticulating splines… 100%
{% endexample %}

Contextual alternatives

Progress bars use some of the same button and alert classes for consistent styles.

{% example html %} {% endexample %}

Striped

Uses a gradient to create a striped effect.

{% example html %} {% endexample %}

Animated stripes

The striped gradient can also be animated. Add .progress-animated to .progress to animate the stripes right to left via CSS3 animations.

Animated progress bars don't work in Opera 12—as they don't support CSS3 animations. They also don't work in IE10+ and Microsoft Edge as those browsers currently don't support CSS3 animations on the ::-ms-fill pseudo-element.

Toggle animation

{% highlight html %} {% endhighlight %}