mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-10 22:24:19 +01:00
211 lines
9.0 KiB
HTML
211 lines
9.0 KiB
HTML
<div class="bs-docs-section">
|
|
<h1 id="progress" class="page-header">Progress bars</h1>
|
|
|
|
<p class="lead">Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars.</p>
|
|
|
|
<div class="bs-callout bs-callout-danger">
|
|
<h4>Cross-browser compatibility</h4>
|
|
<p>Progress bars use CSS3 transitions and animations to achieve some of their effects. These features are not supported in Internet Explorer 9 and below or older versions of Firefox. Opera 12 does not support animations.</p>
|
|
</div>
|
|
|
|
<h3 id="progress-basic">Basic example</h3>
|
|
<p>Default progress bar.</p>
|
|
<div class="bs-example">
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
|
|
<span class="sr-only">60% Complete</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% highlight html %}
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
|
|
<span class="sr-only">60% Complete</span>
|
|
</div>
|
|
</div>
|
|
{% endhighlight %}
|
|
|
|
<h3 id="progress-label">With label</h3>
|
|
<p>Remove the <code>.sr-only</code> class from within the progress bar to show a visible percentage. For low percentages, consider adding a <code>min-width</code> to ensure the label's text is fully visible.</p>
|
|
<div class="bs-example">
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
|
|
60%
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% highlight html %}
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
|
|
60%
|
|
</div>
|
|
</div>
|
|
{% endhighlight %}
|
|
|
|
<h3 id="progress-low-percentages">Low percentages</h3>
|
|
<p>Progress bars representing low single digit percentages, as well as 0%, include a <code>min-width: 20px;</code> for legibility.</p>
|
|
<div class="bs-example">
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
|
|
0%
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 2%;">
|
|
2%
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% highlight html %}
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
|
|
0%
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 2%;">
|
|
2%
|
|
</div>
|
|
</div>
|
|
{% endhighlight %}
|
|
|
|
|
|
<h3 id="progress-alternatives">Contextual alternatives</h3>
|
|
<p>Progress bars use some of the same button and alert classes for consistent styles.</p>
|
|
<div class="bs-example">
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
|
<span class="sr-only">40% Complete (success)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
|
<span class="sr-only">20% Complete</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
|
<span class="sr-only">60% Complete (warning)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
|
<span class="sr-only">80% Complete (danger)</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% highlight html %}
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
|
<span class="sr-only">40% Complete (success)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
|
<span class="sr-only">20% Complete</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
|
<span class="sr-only">60% Complete (warning)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
|
<span class="sr-only">80% Complete</span>
|
|
</div>
|
|
</div>
|
|
{% endhighlight %}
|
|
|
|
<h3 id="progress-striped">Striped</h3>
|
|
<p>Uses a gradient to create a striped effect. Not available in IE8.</p>
|
|
<div class="bs-example">
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
|
<span class="sr-only">40% Complete (success)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
|
<span class="sr-only">20% Complete</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
|
<span class="sr-only">60% Complete (warning)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
|
<span class="sr-only">80% Complete (danger)</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% highlight html %}
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
|
<span class="sr-only">40% Complete (success)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
|
<span class="sr-only">20% Complete</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
|
<span class="sr-only">60% Complete (warning)</span>
|
|
</div>
|
|
</div>
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
|
<span class="sr-only">80% Complete (danger)</span>
|
|
</div>
|
|
</div>
|
|
{% endhighlight %}
|
|
|
|
<h3 id="progress-animated">Animated</h3>
|
|
<p>Add <code>.active</code> to <code>.progress-bar-striped</code> to animate the stripes right to left. Not available in IE9 and below.</p>
|
|
<div class="bs-example">
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"><span class="sr-only">45% Complete</span></div>
|
|
</div>
|
|
</div>
|
|
{% highlight html %}
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
|
|
<span class="sr-only">45% Complete</span>
|
|
</div>
|
|
</div>
|
|
{% endhighlight %}
|
|
|
|
<h3 id="progress-stacked">Stacked</h3>
|
|
<p>Place multiple bars into the same <code>.progress</code> to stack them.</p>
|
|
<div class="bs-example">
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-success" style="width: 35%">
|
|
<span class="sr-only">35% Complete (success)</span>
|
|
</div>
|
|
<div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%">
|
|
<span class="sr-only">20% Complete (warning)</span>
|
|
</div>
|
|
<div class="progress-bar progress-bar-danger" style="width: 10%">
|
|
<span class="sr-only">10% Complete (danger)</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% highlight html %}
|
|
<div class="progress">
|
|
<div class="progress-bar progress-bar-success" style="width: 35%">
|
|
<span class="sr-only">35% Complete (success)</span>
|
|
</div>
|
|
<div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%">
|
|
<span class="sr-only">20% Complete (warning)</span>
|
|
</div>
|
|
<div class="progress-bar progress-bar-danger" style="width: 10%">
|
|
<span class="sr-only">10% Complete (danger)</span>
|
|
</div>
|
|
</div>
|
|
{% endhighlight %}
|
|
</div>
|