博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
通过CSS3伪类,美化Radio按钮样式
阅读量:4657 次
发布时间:2019-06-09

本文共 1165 字,大约阅读时间需要 3 分钟。

CSS3样式:

/* RADIO */

.button-holder {
 width: 100%;
}
.regular-radio {
 display: none;
}
.regular-radio + label {
 -webkit-appearance: none;
 background-color: #fafafa;
 border: 1px solid #cacece;
 box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05);
 padding: 9px;
 border-radius: 50px;
 display: inline-block;
 position: relative;
}
.regular-radio:checked + label:after {
 content: ' ';
 width: 12px;
 height: 12px;
 border-radius: 50px;
 position: absolute;
 top: 3px;
 background: #99a1a7;
 box-shadow: inset 0px 0px 10px rgba(0,0,0,0.3);
 text-shadow: 0px;
 left: 3px;
 font-size: 32px;
}

 

 

代码:

<div class="button-holder">

   <input type="radio" id="radio-1-1" name="radio-1-set" class="regular-radio" checked /><label for="radio-1-1"></label><br />
   <input type="radio" id="radio-1-2" name="radio-1-set" class="regular-radio" /><label for="radio-1-2"></label><br />
   <input type="radio" id="radio-1-3" name="radio-1-set" class="regular-radio" /><label for="radio-1-3"></label><br />
   <input type="radio" id="radio-1-4" name="radio-1-set" class="regular-radio" /><label for="radio-1-4"></label><br />
  </div>

转载于:https://www.cnblogs.com/anhuidu/p/4485570.html

你可能感兴趣的文章
客户端传入数据的校验-RestController进阶
查看>>
靠查看英语资料 , “一不小心”成了国内第一
查看>>
人月神话 中文版 pdf
查看>>
JavaScript高级程序设计(第3版)中文高清完整pdf
查看>>
Oracle性能优化求生指南pdf
查看>>
深度探索C++对象模型.pdf
查看>>
vim中的区块选择与tag
查看>>
Ajax post时需要注意的问题
查看>>
poj 2478 Farey Sequence 欧拉函数
查看>>
符合我公司GIS开源解决方案的探讨
查看>>
weblogic
查看>>
新高一自我剖析
查看>>
翻译「C++ Rvalue References Explained」C++右值引用详解 Part2:Move语义
查看>>
Linux MySQL安装与修改字符格式
查看>>
汉诺塔
查看>>
03html和css
查看>>
MySQL学习笔记
查看>>
JVM类加载机制
查看>>
基于Web的实验室管理系统技术简要报告
查看>>
关于Windows Server自动重启,并出现日志报错WHEA-Logger 47错误解决方案
查看>>