【问题标题】:Set two buttons in the same column with space using angular JS Boostrap使用angularJS Bootstrap在同一列中设置两个带有空格的按钮
【发布时间】:2018-07-23 22:15:10
【问题描述】:

在我的网站中,我试图在同一列中创建两个按钮。我想在这两个按钮之间设置一些空间。我对这种编程语言非常陌生。我尝试了从网上看到的所有方式。我不能成功地做到这一点。这是我尝试创建两个按钮的代码

       <div class="form-group">
         <div class="col-md-12" >
            <button
                 class="btn btn-primary pull-right"
                 translate="TECHNICAL_DETAILS"
                 ng-click="$ctrl.techDetails(conflict)"
            ></button>

           <button
              class="btn btn-primary pull-right"
              ng-if="$ctrl.isConflictEditable(conflict)"
              translate="RESOLVE_CONFLICT"
              ng-disabled="!conflict.active"
              ng-click="$ctrl.editConflict(conflict)"
           ></button>
           <button
             class="btn btn-primary pull-right"
             ng-if="!$ctrl.isConflictEditable(conflict)"
             translate="RESOLVE_CONFLICT_NOW"
             ng-disabled="!conflict.active"
             ng-click="$ctrl.resolveConflict(conflict)"
          ></button>

          </div>
      </div>

您正在使用 BOOTSTRAP 类,并且按钮显示在一行中。您可以将按钮插入不同的部分,并使用可用的类来对齐两个部分。

<div class="form-group">
    <div class="col-md-2" id="firstBtnSection">
        <button class="btn btn-primary pull-right" translate="TECHNICAL_DETAILS" ng-click="$ctrl.techDetails(conflict)"></button>
    </div>
    <div class="col-md-6 col-md-offset-2" id="secondBtnSection">
        <button class="btn btn-primary pull-right" ng-if="$ctrl.isConflictEditable(conflict)" translate="RESOLVE_CONFLICT" ng-disabled="!conflict.active" ng-click="$ctrl.editConflict(conflict)"></button>
    <button class="btn btn-primary pull-right" ng-if="!$ctrl.isConflictEditable(conflict)" translate="RESOLVE_CONFLICT_NOW" ng-disabled="!conflict.active" ng-click="$ctrl.resolveConflict(conflict)"></button>
    </div>
</div>

或者您可以为“secondBtnSection” div 元素添加一些边距。

【问题讨论】:

    标签: javascript angularjs html button angular-ui-bootstrap


    【解决方案1】:

    如我所见,您正在使用 bootsrtap。因此,您可以在第一个和第二个按钮上添加一个 mr-3 类,它会在按钮之间添加一些边距

    【讨论】:

    • 如何添加这个类,我已经在 btn 里面添加了 btn-primary pull-right
    猜你喜欢
    • 1970-01-01
    • 2019-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-27
    • 1970-01-01
    • 1970-01-01
    • 2010-11-14
    相关资源
    最近更新 更多