如何让两个按钮组成一排?

时间:2015-11-10 17:06:42

标签: html css twitter-bootstrap

我有这个HTML代码:

<div class="form-group col-sm-12 row">
    <div class="col-sm-3 ">
        <div class="form-group row">
            <a ui-sref="inspectionsBuilder.view.step3" class="btn btn-block btn-info">
                Previus <span class="glyphicon glyphicon-circle-arrow-right"></span>
            </a>
        </div>
    </div>


    <div class="btn-group">
        <a href="#" class="btn btn-block btn-info" ng-click="builderStep4.save(true)">Save and...</a>
        <a href="#" class="btn btn-block btn-info" ng-click="builderStep4.save()">Save</a>
    </div>
</div>

在这里看起来如何:

enter image description here

我需要在一行中设置SaveSave and按钮,将它放在左侧,如下所示:

enter image description here

我有一些难以实现它,任何想法?

Fiddler:https://jsfiddle.net/99x50s2s/144/

2 个答案:

答案 0 :(得分:0)

尝试.btn-group a {float:left;}

答案 1 :(得分:0)

以下是您提供的代码段的可能解决方案,

https://jsfiddle.net/99x50s2s/145/

我删除了btn-block类并重新对齐html,使其看起来像你的期望。

<强> HTML

<div class="row">
    <div class="col-xs-6">
        <a href="#" class="btn btn-info" ng-click="builderStep4.save()">Save</a>
         <a href="#" class="btn btn-info" ng-click="builderStep4.save(true)">Save and...</a>
         <a ui-sref="inspectionsBuilder.view.step3" class="btn btn-info pull-right">
                Previus <span class="glyphicon glyphicon-circle-arrow-right"></span>
            </a>
    </div>
</div>