Bootstrap 3 and Bootstrap 4 solution.
Demo: https://jsfiddle.net/elijahmurray/7tgh988z/
I struggled with finding a good solution to this problem for awhile. Ultimately, I ended up writing my own that is semantically similar to how Bootstrap structures their progress bars.
This solution also doesn't use transform
, which I found really messed up a lot of things with positioning when using it. Not to mention, it just got confusing with that.
HTML
<div class="progress progress-bar-vertical">
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="height: 60%;">
<span class="sr-only">60% Complete</span>
</div>
</div>
CSS
.progress-bar-vertical {
width: 20px;
min-height: 100px;
margin-right: 20px;
float: left;
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6, BB7 */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Safari 6.1+. iOS 7.1+, BB10 */
display: flex; /* NEW, Spec - Firefox, Chrome, Opera */
align-items: flex-end;
-webkit-align-items: flex-end; /* Safari 7.0+ */
}
.progress-bar-vertical .progress-bar {
width: 100%;
height: 0;
-webkit-transition: height 0.6s ease;
-o-transition: height 0.6s ease;
transition: height 0.6s ease;
}
Vote if this was helpful!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…