html checkbox和label 文字不对齐解决办法
做用html或bootstrap时,表单元素和文字不对齐现实,不管用什么vertical-align:middle
,也无法解决。
先看现象:
<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>
解决办法:
.flex{display:flex; align-items:center;}
<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>