对齐按钮 - bootstrap 3

时间:2014-06-14 22:43:02

标签: css twitter-bootstrap-3

看一下下面的例子。

Sample

我正在尝试将极左侧的按钮1和最右侧的按钮2和按钮3对齐。有没有更好的方法来做到这一点,而不是抵消。

2 个答案:

答案 0 :(得分:2)

您只需将其添加到包含右侧按钮的div中:

text-align:right;

您在当前设置中不需要偏移,因为您正在使用右拉。

如果您希望它在小屏幕上的行为相似,请将col-md更改为col-xs,否则宽度默认为100%是块级元素。

xs示例:http://www.bootply.com/s8T3y5qJ7c

答案 1 :(得分:1)

这对我来说很好:

<div class="col-md-4 col-md-offset-6 pull-right">
     <button type="reset" style="float:right;" class="btn btn-default">
        Button 2</button>
     <button type="reset" style="float:right;" class="btn btn-default">
        Button 3</button>
</div>

这是您更新的脚本:

here