在做东湖大数据的大数据众包的一个页面时,遇到了一个地方需要自定义radio按钮,于是我在优快云搜索相关文章,恰巧就搜到了一篇教自定义radio得1文章,然后我在大致看懂原理后开是仿照他的代码打。下面的是初次代码,问题很多。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
input[type=radio]{
clip: rect(0,0,0,0);
position: absolute;
}
input[type=radio]+label::before{
/*漏1*/
content: "";
background:#fff;
border: solid red 1px;
width: 15px;
height: 15px;
border-radius:50%;
float: left;
margin-left:6px ;
margin-top: 5px;
}
/*添加选中样式*/
input[type=radio]:checked+label::before{
background-color: skyblue;
background-clip: content-box;
padding: 3px;
}
</style>
</head>
<body>
<input type="radio" name="1"/>
<label>hahaha</label>
<input type="radio&#