要在text或者label上显示手型图标

mx:Label text="click me"
     useHandCursor="true"    
     buttonMode="true"    
     mouseChildren="false"/>  

 

可以使用CSS来设置复选框的样式,下面是一个示例代码: HTML代码: ``` <label> <input type="checkbox" value="option1"> 全部 </label> ``` CSS代码: ``` input[type="checkbox"] { -webkit-appearance: none; -moz-appearance: none; appearance: none; border: 2px solid #ccc; border-radius: 4px; width: 20px; height: 20px; display: inline-block; position: relative; vertical-align: middle; cursor: pointer; } input[type="checkbox"]:checked::before { content: "\2713"; display: block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; color: #fff; background-color: #007bff; border-radius: 50%; width: 20px; height: 20px; line-height: 20px; text-align: center; } ``` 解释一下上面的代码: - `-webkit-appearance: none;`、`-moz-appearance: none;`、`appearance: none;`用来去掉浏览器默认的复选框样式; - `border: 2px solid #ccc;`设置边框; - `border-radius: 4px;`设置边框圆角; - `width: 20px;`、`height: 20px;`设置复选框的宽高; - `display: inline-block;`、`position: relative;`、`vertical-align: middle;`用来让复选框垂直居中; - `cursor: pointer;`设置鼠标指针为手型,表示可以点击。 `input[type="checkbox"]:checked::before`选择器用来设置复选框勾选时的样式,其中`content: "\2713";`用来设置勾选图标,`\2713`是勾选符号的 Unicode 码。`position: absolute;`、`top: 50%;`、`left: 50%;`、`transform: translate(-50%, -50%);`用来将勾选图标居中。`font-size: 16px;`、`color: #fff;`、`background-color: #007bff;`用来设置勾选图标的样式。`border-radius: 50%;`、`width: 20px;`、`height: 20px;`、`line-height: 20px;`、`text-align: center;`用来让勾选图标圆形居中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值