Jos*_*eph 4 css label twitter-bootstrap bootstrap-4
如何使该标签正确对齐?我只能左对齐。我要重写的引导4默认值justify-content: center来justify-content: right !important;但它对齐到左边。如何将其向右对齐?
<div class="modal-body">
<form class="form-horizontal">
<div class="form-inline">
<label class="col-md-4">Type</label>
<input class="col-md-8" type="email" class="form-control">
</div>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
div.form-inline label.col-md-4 {
justify-content: right !important;
}
Run Code Online (Sandbox Code Playgroud)
小智 13
将“text-right”类添加到标签
<div class="modal-body">
<form class="form-horizontal">
<div class="form-inline">
<label class="col-md-4 text-right">Type</label>
<input class="col-md-8" type="email" class="form-control">
</div>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
您需要将其更改为:
div.form-inline label.col-md-4{
justify-content: flex-end;
}
Run Code Online (Sandbox Code Playgroud)
justify-content: right 不是有效值。
| 归档时间: |
|
| 查看次数: |
6484 次 |
| 最近记录: |