gpt4 book ai didi

html - 每个浏览器的伪内容属性各不相同

转载 作者:太空宇宙 更新时间:2023-11-04 11:15:08 25 4
gpt4 key购买 nike

我正在使用自定义 CSS 来设置单选框的样式,但现在的问题是

checked radio circle is appearing at diff positions in IE11, FF36 and Chrome. Below is the illustration

enter image description here

用于实现此目的的 CSS 如下:

label {
display: inline-block;
cursor: pointer;
position: relative;
padding-left: 32px;
}

input[type=radio] {
display: none;
}

label:before {
content: "";
display: inline-block;
width: 23px;
height: 22px;
margin-right: 10px;
position: absolute;
left: 0;
border:1px solid $grey;
border-radius: 50px;
}

input[type=radio]:checked + label:before {
content: "\25CF";
border:1px solid $light-blue;
color: $light-blue;
font-size: 26px;
text-align: center;
line-height: 0rem;
padding-top: 7px;
}

任何想法请在所有浏览器中以相同的方式工作..

最佳答案

我改变了方法。我没有使用内容和行高,而是按如下方式切换

label:before {
content: "";
display: inline-block;
width: 20px;
height: 20px;
margin-right: 10px;
position: absolute;
padding:1px;
left: 0;
border:1px solid black;
border-radius: 50px;
}

input[type=radio]:checked + label:before {
border:1px solid blue;
background-color:blue;
box-shadow: 0 0 0 3px #fff inset;
width: 20px;
height: 20px;
}

JS Fiddle

关于html - 每个浏览器的伪内容属性各不相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33300659/

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