css自定义radio选择样式

/*两个复选框box浮动,方便设置css*/
			.radio{
				display:-moz-box;
				display:-webkit-box;
				display:box;
				float:left;
			}
			/*让原有的复选框图案隐藏*/
			.radios input[type=radio]{
				display: none;
			}
			/*图片和文字都放在label里面*/
			.radios span{
				display:-moz-box;
				display:-webkit-box;
				display:box;
				float:left;
				line-height: 20px;/*不设行高文字垂直方向不居中*/
				text-indent: 30px;/*使文字缩进:文字和图片都在label里面,不缩进文字和图片叠加在一起*/
				background:url(${ctxPath}/static/image/radios_false.png) no-repeat left top;/*背景图片*/
				background-size: 20px 20px;/*设置背景图片大小*/
			}
			.radios input[type=radio]:checked + span{
				background:url(${ctxPath}/static/image/radios_true.gif) no-repeat left top;/*被选中时,换背景图片*/
				background-size: 20px 20px;
			}
<div class="radios" v-for="(item,index) in List">
						<label>
							<input type="radio" name="optionsRadios" id="optionsRadios1" :value="item.pro_id"  :checked="item.pro_id==Id"/>
							<span :id="item.pro_id">{{item.pro_name}}</span>
						</label>
					</div>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值