我有这样的复选框:
<label class="checkbox-label"><input type="checkbox" value="115">Administrators</label>
Run Code Online (Sandbox Code Playgroud)
但是我无法理解如何将标签设置为中心对齐复选框.
我尝试添加 vertical-align:middle;
谢谢
Art*_*äpp 56
这就是我对你的代码所做的.
HTML
<label class="checkbox-label"><input type="checkbox" value="115">-middle</label>
Run Code Online (Sandbox Code Playgroud)
CSS
label.checkbox-label input[type=checkbox]{
position: relative;
vertical-align: middle;
bottom: 1px;
}
Run Code Online (Sandbox Code Playgroud)
尝试使用:
vertical-align: text-bottom;
Run Code Online (Sandbox Code Playgroud)
编辑:
<input id="checkbox" type="checkbox" value="115">
<label class="checkbox-label" for="checkbox">Administrators</label>
Run Code Online (Sandbox Code Playgroud)