垂直对齐复选框标签? [英] Vertical align checkbox label?

查看:94
本文介绍了垂直对齐复选框标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的复选框:

 < label class =checkbox-label>< input type = checkboxvalue =115>管理员< / label> 

但我无法理解如何将标签的样式设置为复选框的中心值。



我试着添加 vertical-align:middle;



解决方案

这就是我对你的代码所做的。 strong> html

 < label class =checkbox-label>< input type =复选框value =115> -middle< / label> 

css

  label.checkbox-label input [type = checkbox] {
position:relative;
vertical-align:middle;
bottom:1px;
}

小提琴


I have checkboxes like this:

<label class="checkbox-label"><input type="checkbox" value="115">Administrators</label>

But I cannot fugure out how to style the label to be center valigned to the checkbox.

I tried adding vertical-align:middle;

Thanks

解决方案

This is what I did with your code.

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;
}

Fiddle

这篇关于垂直对齐复选框标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆