input radio单选框前面的小图标怎么换掉,换成自己需要的图片,用css...
发布网友
发布时间:2024-10-09 21:01
我来回答
共1个回答
热心网友
时间:2024-11-14 02:51
p{width:100px; overflow:hidden;}
p:hover{ background:url(a.jpg) 25px 8px no-repeat;}
label{ float:right;}
input{background:url(a.jpg) left no-repeat;height:24px; margin-left:-15px;}
<p><input name="shuzi" id="shuzi1" type="radio" /><label onclick="this.style.background ='url(a.jpg) 25px 8px no-repeat'" for="shuzi1">shuzi1</label></p>
<p><input name="shuzi" id="shuzi2" type="radio" /><label onclick="this.style.background ='url(a.jpg) 25px 8px no-repeat'" for="shuzi2">shuzi2</label></p>
<p><input name="shuzi" id="shuzi3" type="radio" /><label onclick="this.style.background ='url(a.jpg) 25px 8px no-repeat'" for="shuzi3">shuzi3</label></p>
因为在做单选的时候,一般会和label一起使用,所以可以将input隐藏,另加一个背景,
拙见