我正在尝试使用 Bootstrap 进度条作为加载指示器,我希望进度条具有一定的宽度,并且整个进度条都位于 DIV 的中心。但是进度条好像不太喜欢居中。
当我这样做时:
<div class="text-center">
<img src="~/Content/Images/loading.gif" style="height:80px;" />
</div>
图像正确居中。但是当我用它代替进度条时,它会向左移动:
<div class="text-center">
<div class="progress" style="width:200px;"> <!-- set to certain width -->
<div class="progress-bar progress-bar-striped active" role="progressbar" style="width: 100%;">
<span>
Loading...
</span>
</div>
</div>
</div>
我希望进度条居中显示。
最佳答案
这段 CSS 对我有用。
.progress { margin-left: auto; margin-right:auto; }
关于html - 在 div 上 Bootstrap 中心进度条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26181507/