java中jlaber用法_laber的for属性

laber的for属性的作用:通过for属性,可以实现通过点击label标签来达到相当于点击input的作用。

常用于:美化input标签

例子:

html:

前端工程师

后端工程师

全栈工程师

css:

.radio-beauty-container {

font-size: 0;

$bgc: green;

%common {

padding: 2px;

background-color: $bgc;

background-clip: content-box; //裁剪的是label标签不包含padding的部分

position: relative;

top: 0px;

}

.radio-name {

vertical-align: middle;

font-size: 16px;

}

.radio-beauty {

width: 18px;

height: 18px;

box-sizing: border-box;

display: inline-block;

border: 1px solid $bgc;

vertical-align: middle;

margin: 0 15px 0 3px;

border-radius: 50%;

&:hover {

box-shadow: 0 0 7px $bgc;

@extend %common;

}

}

input[type="radio"]:checked+.radio-beauty {

@extend %common;

}

}

效果图:

26e6522115b6

微信图片_20180420111905.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值