做用html或bootstrap时,表单元素和文字不对齐现实,不管用什么vertical-align:middle
,也无法解决。
先看现象:
html
<input type="radio" id="agreed" name="Appeal" value="Agreed" class="form-control radioAppeal"> <label for="agreed" style="margin-right: 20px;">同意</label>
<input type="radio" id="rejected" name="Appeal" value="Rejected" class="form-control radioAppeal"> <label for="rejected">不同意</label>
解决办法:
csss
.flex{display:flex; align-items:center;}
bash
<div class="flex">
<input type="radio" id="agreed" name="Appeal" value="Agreed" class="form-control radioAppeal"> <label for="agreed" style="margin-right: 20px;">同意</label>
<input type="radio" id="rejected" name="Appeal" value="Rejected" class="form-control radioAppeal"> <label for="rejected">不同意</label>
</div>