我正在创建自举面板,问题在于将文本对齐,中间的用户图标和左边的剩余文件。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading clearfix">
<h4 class="panel-title pull-left" style="padding-top: 7.5px;">Panel header</h4>
<div class="pull-center">
<button class="btn btn-primary"><i class="glyphicon glyphicon-user"></i></button>
</div>
<div class="pull-right">
<button class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
<button class="btn btn-primary"><i class="glyphicon glyphicon-wrench"></i></button>
</div>
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div>
答案 0 :(得分:0)
像这样使用像text-center
这样的整个标题..
<div class="panel panel-primary">
<div class="panel-heading text-center">
<h4 class="panel-title pull-left" style="padding-top: 7.5px;">Panel header</h4>
<button class="btn btn-primary"><i class="glyphicon glyphicon-user"></i></button>
<div class="pull-right">
<button class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
<button class="btn btn-primary"><i class="glyphicon glyphicon-wrench"></i></button>
</div>
</div>
<div class="panel-body">
Panel content
</div>
</div>