Bootstrap分段进度条

时间:2016-04-20 08:51:00

标签: twitter-bootstrap-3

我是bootstrap的新手。我需要创建一个分段进度条(附图),每个部分上面都有标签。我尝试过使用列类的多个div,但无法达到确切的要求。

enter image description here

1 个答案:

答案 0 :(得分:1)

尝试使用 Bootstrap Stacked Progress Bars 例如:

通过将多个小条放入相同的<div class="progress">

来创建堆叠进度条
<div class="progress">

    <div class="progress-bar progress-bar-success" role="progressbar" style="width:40%"> Free Space</div>

    <div class="progress-bar progress-bar-warning" role="progressbar" style="width:10%">Warning</div>

    <div class="progress-bar progress-bar-danger" role="progressbar" style="width:20%">Danger</div>

</div>

请参阅w3schools.com DEMO

查看此示例: 我希望它可以根据您的需要运行,谢谢。

&#13;
&#13;
.progress-bar-success{
  border:solid 1px;
}
  
&#13;
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<br /><br />
<div class="container">
  <div class="progress">
    <div class="progress-bar progress-bar-success" role="progressbar" style="width:20%">Label 1</div>
    <div class="progress-bar progress-bar-success" role="progressbar" style="width:20%">Label 2</div>
    <div class="progress-bar progress-bar-success" role="progressbar" style="width:20%">Label 3</div>
    <div class="progress-bar progress-bar-success" role="progressbar" style="width:20%">Label 4</div>
    <div class="progress-bar progress-bar-success" role="progressbar" style="width:20%">Label 5</div>
  </div>
</div>

</body>
</html>
&#13;
&#13;
&#13;