css - 如何使用 Bootstrap 将按钮居中对齐

标签 css twitter-bootstrap twitter-bootstrap-3

我使用 Bootstrap 创建了一个磁贴。在图 block 内部,靠近底部,我想要图 block 的三个按钮(开始、中间和结束)。

我制作了开始和结束按钮,但使用了两个 div 标签以及 pull-leftpull-right 类。现在我想要的是放置中间按钮。

这是我的部分代码和截图:

enter image description here

<div class="col-lg-12">
    <div class="pull-left">
        <button class="btn btn-primary btn-sx" type="button">Confirm</button>
    </div>

    <!-- I want another button here, center to the tile-->

    <div class="pull-right">
        <button class="btn btn-primary btn-xs pull-right" type="button">Decline</button>
    </div>
</div>

最佳答案

使用这个选项:

<div class="text-center">
    <button class="btn btn-primary btn-sx" type="button">
        Confirm
    </button>
</div>

关于css - 如何使用 Bootstrap 将按钮居中对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32183096/

相关文章:

JavaFX ChoiceBox 上下文菜单位置

html - 设计具有悬停效果的按钮

html - 响应式布局 : best ways to keep a sidebar reachable

html - 上传按钮未按预期显示,填充/边距无效

javascript - 将 PHP 值传递给 Twitter Bootstrap 模式

javascript - Bootstrap 的 css 样式切换器

css - 复选框在 mac chrome 中没有样式

css - 在 Bootstrap 表中的表行上停用悬停状态

html - 安排多个div如何最好地处理布局

html - 如何在我的案例中定位我的链接?