gpt4 book ai didi

html - 是否可以更改所选单选按钮中心圆的颜色

转载 作者:技术小花猫 更新时间:2023-10-29 12:17:22 25 4
gpt4 key购买 nike

是否可以设置所选单选按钮的中心圆的样式,至少在 webkit 浏览器中...?

我现在拥有的是:enter image description here

我想要的:enter image description here

我可以如下更改背景颜色、阴影等

#searchPopup input[type="radio"]{
-webkit-appearance:none;
box-shadow: inset 1px 1px 1px #000000;
background:#fff;
}

#searchPopup input[type="radio"]:checked{
-webkit-appearance:radio;
box-shadow: none;
background:rgb(252,252,252);
}

任何想法..?

最佳答案

您可以使用一些圆形边框技巧(呈现外圈)和伪元素 :before(呈现内圈)来模仿单选按钮,幸运的是,它可以用于输入radio 类型的字段:

input[type='radio'] {
-webkit-appearance:none;
width:20px;
height:20px;
border:1px solid darkgray;
border-radius:50%;
outline:none;
box-shadow:0 0 5px 0px gray inset;
}

input[type='radio']:hover {
box-shadow:0 0 5px 0px orange inset;
}

input[type='radio']:before {
content:'';
display:block;
width:60%;
height:60%;
margin: 20% auto;
border-radius:50%;
}
input[type='radio']:checked:before {
background:green;
}

Working Demo.

关于html - 是否可以更改所选单选按钮中心圆的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23167637/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com