设置按钮右和&中心引导警报框

时间:2017-07-26 22:46:23

标签: twitter-bootstrap

我正在尝试将警报按钮设置为右侧并居中于警告框中。按钮向右拉,但不会居中。这是我的Bootply:https://www.bootply.com/ORxGVJq0kG#

<div class="container-fluid">
  <div class="row">
    <div class="col-md-10 col-md-offset-1">
      <div class="alert alert-warning alert-dismissible fade in text-center" role="alert"><strong>Holy guacamole!</strong>Best check yo self, you're not looking too good.<button class="btn btn-primary pull-right" onclick="finish()" type="button">Finish</button></div>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

尝试将“text-center”类添加到按钮并将其添加到警报: style="line-height: 34px;"因为按钮的高度为34px,这意味着容器的行高也必须为34px。