关于checkbox,radio与文字没法对齐
input[type=checkbox]{vertical-align:middle; margin-top:-2px; margin-bottom:1px;}
input[type=radio]{vertical-align:middle; margin-top:-2px; margin-bottom:1px;}
改变checkbox,radio的勾颜色
input[type="checkbox"]{
-webkit-appearance:none;
width:13px;
height:13px;
background:url(../images/input.png) no-repeat -22px 0;
}
input[type="checkbox"]:focus{
outline:none;
}
input[type="checkbox"]:checked{
background:url(../images/input.png) no-repeat 0px 0;
}
本文介绍如何使用CSS解决Checkbox与Radio按钮的文字对齐问题,并展示如何更改选中状态的颜色及样式。通过调整垂直对齐及边距属性实现元素间的精确对齐,并通过背景图片自定义选中状态的表现。
799

被折叠的 条评论
为什么被折叠?



