请检查图像。我想将输入字段与输入字段名称对齐,更多在中央,现在输入字段与输入字段名称在同一级别上对齐。
以下是代码
<div class="form-group basestations">
<label class="col-sm-3 control-label">{% trans "Management Network IP Address" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="mni_address" value="192.168.255.129" id = "addr" maxlength="20" required pattern="^(25[0-5]|2[0-4]\d|[0-1]?\d?[1-9]|[0-1]?[1-9][0])(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$">
</div>
</div>
答案 0 :(得分:0)
尝试给.form-group .basestations
div vertical-align: middle;
这应将元素中的所有项目垂直居中对齐。如果这不起作用,请告诉我!
快速测试应该是:
<div class="form-group basestations" style="vertical-align: middle;">
<label class="col-sm-3 control-label">{% trans "Management Network IP Address" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="mni_address" value="192.168.255.129" id = "addr" maxlength="20" required pattern="^(25[0-5]|2[0-4]\d|[0-1]?\d?[1-9]|[0-1]?[1-9][0])(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$">
</div>
</div>