Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这样的复选框:
<label class="checkbox-label"><input type="checkbox" value="115">Administrators</label>
但我无法弄清楚如何将标签设置为与复选框居中对齐。
我尝试添加vertical-align:middle;
vertical-align:middle;
谢谢
这就是我对你的代码所做的。
html
<label class="checkbox-label"><input type="checkbox" value="115">-middle</label>
css
label.checkbox-label input[type=checkbox]{ position: relative; vertical-align: middle; bottom: 1px; }
小提琴
Try using:
vertical-align: text-bottom;
Edit:
<input id="checkbox" type="checkbox" value="115"> <label class="checkbox-label" for="checkbox">Administrators</label>
调整标签的行高。