<div class="radio-box">
<div>
<input type="radio" name="state" id="state1" value="1" />
<label for="state1">了解项目</label>
<input type="radio" name="state" id="state2" value="2" />
<label for="state2">自己家检测治理</label>
</div>
</div>
css:
input[type="radio"] {
width: 22px;
height: 22px;
opacity: 0;
}
input[type="radio"] + label::before {
display: inline-block;
width: 22px;
height: 22px;
border-radius: 50%;
border: 1px solid #d9d9d9;
-webkit-box-sizing: border-box;
box-sizing: border-box;
content: "";
background: #C5C5C5;
}
input[type="radio"]:checked + label::before {
background-color:#416BDB;
background-clip: content-box;
border-color:#d1d9f0;
border-width: 5px;
}
效果