目前,我正在一个项目与反应和启动。现在我想定制无线电按钮,以适应其他颜色。如果检查过,是否有办法用引导带改变无线电按钮的颜色?
(预先谢谢:)
发布于 2022-09-03 18:43:35
您可以使用CSS实现这一点。
input[type="radio"] {
/* remove standard background appearance */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
/* create custom radiobutton appearance */
display: inline-block;
width: 25px;
height: 25px;
padding: 6px;
/* background-color only for content */
background-clip: content-box;
border: 2px solid #bbbbbb;
background-color: #e7e6e7;
border-radius: 50%;
}
/* appearance for checked radiobutton */
input[type="radio"]:checked {
background-color: #93e026;
}
/* optional styles, I'm using this for centering radiobuttons */
.flex {
display: flex;
align-items: center;
}
<div class="flex">
<input type="radio" name="radio" id="radio1" />
<label for="radio1">Button1</label>
</div>
<div class="flex">
<input type="radio" name="radio" id="radio2" />
<label for="radio2">Button2</label>
</div>
https://stackoverflow.com/questions/73594577
复制相似问题