Html 对齐“选择”标记中的渲染选项文本
我有这个html:Html 对齐“选择”标记中的渲染选项文本,html,css,angularjs,twitter-bootstrap,Html,Css,Angularjs,Twitter Bootstrap,我有这个html: <div class="form-group"> <label for="catId">Category</label> <select class="form-control" id="catId" ng-model="intCategory" ng-options="c.Id as c.Category for c i
<div class="form-group">
<label for="catId">Category</label>
<select class="form-control" id="catId" ng-model="intCategory"
ng-options="c.Id as c.Category for c in intCategories">
<option value="">--Select--</option>
</select>
</div>
类别
--挑选--
我正在使用css和angularjs的引导来呈现选项。除了选项文本显示为向左对齐外,所有操作都正常。如何将选项文本居中?您可以尝试使用“文本中心””类,如下所示:
<div class="form-group">
<label for="catId">Category</label>
<select class="form-control text-center" id="catId" ng-model="intCategory" ng-options="c.Id as c.Category for c in intCategories">
<option value="">--Select--</option>
</select>
</div>
类别
--挑选--
或
——选择--
它可以很好地与引导一起工作。如果我在父div标记中包含一个内联块的显示,那么它就可以工作了。真奇怪 以下是更新的html:
<div class="form-group" style="display: inline-block;">
<label for="catId">Category</label>
<select class="form-control" id="catId" ng-model="intCategory"
ng-options="c.Id as c.Category for c in intCategories">
<option class="" value="">--Select--</option>
</select>
</div>
类别
--挑选--
是的,我已经试过了。好像有什么东西引起了冲突。
<div class="form-group" style="display: inline-block;">
<label for="catId">Category</label>
<select class="form-control" id="catId" ng-model="intCategory"
ng-options="c.Id as c.Category for c in intCategories">
<option class="" value="">--Select--</option>
</select>
</div>