使用css样式制作单选框

互联网 20-5-31

我们直接来看一下具体的实现代码:

(如果您想学习css,那么这里向您推荐css视频教程)

<!DOCTYPE html> <html>  <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title>     <link rel="stylesheet" href="./reset.css">     <style>         .radio-diy .radiocircle {             width: 12px;             height: 12px;             border: 1px solid #999;             border-radius: 50%;             cursor: pointer;             display: inline-block;         }                  .radio-diy input:checked+span {             border: 1px solid#008c8c;         }          .radio-diy input:checked~span {             color: #008c8c;         }          .radio-diy input:checked+span.radiocircle::after {             content: "";             display: block;             width: 6px;             height: 6px;             background: #008c8c;             border-radius: 50%;             cursor: pointer;             margin-left: 3px;             margin-top: 3px;         }            input[type="radio"] {             display: none;         }     </style> </head>  <body>     请选择性别:     <label>         <input type="radio" name="gender" value="male">         <span></span>         <span>男</span>     </label>     <label>         <input type="radio" name="gender" value="female">         <span></span>         <span>女</span>     </label> </body>  </html>  radio.css

推荐教程:css快速入门

以上就是使用css样式制作单选框的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
标签: 单选框
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:什么是盒子模型

相关资讯