input radio单选框前面的小图标怎么换掉,换成自己需要的图片,用css
展开全部
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隐藏,另加一个背景,
拙见
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隐藏,另加一个背景,
拙见
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询