【问题标题】:Add number steps on top of bootstrap progress bar在引导进度条顶部添加数字步骤
【发布时间】:2020-11-13 05:24:00
【问题描述】:

如何在 Bootstrap 4 进度条的顶部添加步骤(里面有数字的圆圈),以使其均等。我的想法是这样的:

// css
.wrapper-progress-step {
  /* what should go here? this would guarantee that steps are 'floating' on top of the bar*/
}

.steps {
  /*what should go here? probably position relative to go on top of the bar*/
}

.circle {
  width: 30px;
  height: 30px;
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  line-height: 1.428571429;
  border-radius: 15px;
  margin-top: 0;
}
<div class="wrapper-progress-step">
  <div class="progress">
    <div class="progress-bar bg-success" role="progressbar" style="width: 80%" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100">
    </div>
  </div>
  <!-- this should go above the progress bar dividing the bar in equally spaces -->
  <div class="steps">
    <div class="circle">1</div>
    <div class="circle">2</div>
    <div class="circle">3</div>
    <div class="circle">4</div>
  </div>
</div>

你们觉得这种方式可行吗?接受新想法

【问题讨论】:

    标签: css bootstrap-4 flexbox


    【解决方案1】:
    .steps {
      display: flex;
      justify-content: space-evenly;
      width: 100%;
     }
    

    Flexbox 提供了一种简单的平等分配方式。我认为这会给你一个正确的方向。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-19
      • 2023-04-05
      • 1970-01-01
      • 2023-01-12
      • 2017-04-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多