如何在同一个div中的两个按钮之间创建空格?
问题描述:
水平排列Bootstrap按钮的最佳方法是什么?
What is the best way to horizontally space Bootstrap buttons?
按钮触摸时:
<div class="btn-group">
<button class="btn btn-inverse dropdown-toggle" data-toggle="dropdown">
<i class="icon-in-button"></i>
Add to list
<span class="caret"/>
</button>
<ul class="dropdown-menu">
<li>
<a href="#">here</a>
</li>
<li>
<a href="#">new</a>
</li>
</ul>
<button class="btn btn-info">
<i class="icon-in-button"></i>
more
</button>
</div>
jsfiddle显示问题: http://jsfiddle.net/hhimanshu/sYLRq/4 /
jsfiddle showing the problem: http://jsfiddle.net/hhimanshu/sYLRq/4/
答
将它们放在 btn-toolbar
一些其他容器,不是 btn-group
。 btn-group
将它们连接在一起。有关Bootstrap的详情,请参阅文档。
Put them inside btn-toolbar
or some other container, not btn-group
. btn-group
joins them together. More info on Bootstrap documentation.
编辑:原始问题适用于Bootstrap 2.x,但同样适用于 Bootstrap 3 。
The original question was for Bootstrap 2.x, but the same is still valid for Bootstrap 3.