我刚刚学习了 bootstrap 并尝试使用 bootstrap 4 将表单居中,但似乎一直失败。我试过 put container、margin auto、grid 等,但仍然失败。
这是使用引导网格的最后一个代码。
<form class="col-lg-6 offset-lg-3">
<div class="row">
<input type="text" placeholder="Example input">
<span class="input-group-btn">
<button class="btn btn-primary">Download</button>
</span>
</div>
</form>
这是链接 https://jsfiddle.net/artjia/emsw7t93/
原文由 bakaio 发布,翻译遵循 CC BY-SA 4.0 许可协议