本篇文章给大家带来的内容是关于css如何自定义radio单选框样式 ?(代码实现),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
html部分
css样式部分
.radio { width: 260px; height: 26px; line-height: 26px; margin: 200px auto; background-color: #ddeef1; font-size: 16px; color: #495060; text-align: center; } label:first-child { margin-right: 40px; } label input, .radio_on { display: none; } .pos { display: inline; vertical-align: middle; } .radio_bg { position: relative; display: inline-block; height: 14px; width: 14px; border: 1px solid #B3B4B8; border-radius: 50%; } label:hover .radio_bg, label input:checked + span.pos span.radio_bg { border: 1px solid #27B28B; } label input:checked + span.pos span.radio_bg .radio_on { display: inline-block; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background-color: #27B28B; }
效果图

立即学习“前端免费学习笔记(深入)”;
相关推荐:
HTML的checkbox和radio怎样美化样式
使用CSS自定义radio、checkbox样式的示例详解
以上就是css如何自定义radio单选框样式 ?(代码实现)的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1611278.html
微信扫一扫
支付宝扫一扫