gpt4 book ai didi

html - 进度条-如何添加标记/标线

转载 作者:行者123 更新时间:2023-11-28 02:20:14 28 4
gpt4 key购买 nike

我在 Bootstrap 中有一个垂直进度条(在 React 组件中实现),我想在上面放置水平标记。换句话说,现在进度条已经填充到当前预期 yield ,我还想用横跨进度条的水平线标记目标 yield 。有什么想法吗?

<div className="w-25 m-1">
<div className="progress progress-bar-vertical ">
<div
className="progress-bar"
role="progressbar"
aria-valuenow={yieldInKG}
aria-valuemin="0"
aria-valuemax={maxValue}
style={{ height: '{ barHeight }%' }}>
<span>{percentage}%</span>
</div>
</div>
</div>

最佳答案

编辑:下面的代码可以单独使用 native Bootstrap 类来完成这项工作。您可以尝试 bg-secondary 类,而不是 bg-light

代码如下:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">


<div class="progress progress-bar-vertical">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">25%</div>
<div class="progress-bar bg-light" role="progressbar" style="width: 30%" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar bg-primary" role="progressbar" style="width: .3%"></div>
</div>


<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4" crossorigin="anonymous"></script>

关于html - 进度条-如何添加标记/标线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48250629/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com