gpt4 book ai didi

css - 未呈现 Internet Explorer 'input:checked + label:before' 样式

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

我在为我的自定义复选框设置 :checked 样式以在 Internet Explorer 中显示时遇到一些问题。

它们在 Chrome 中工作得很好。

enter image description here

...但是在 IE 中

enter image description here

这是相关的样式

input[type="radio"], input[type="checkbox"] {
opacity: 1;
position: absolute;
top: -9999;

& + label {
vertical-align: middle;
}
}

input[type="radio"] + label:before,
input[type="checkbox"] + label:before {
content: '\f3fd';
font-family: 'Ionicons';
width: 26px;
height: 20px;
border: 2px solid #45555F;
font-size: 24px;
color: transparent;
display: table-cell;
text-align: center;
transition: all 0.3s linear;
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-ms-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
padding: 0 2px;
}

input[type="radio"]:checked + label:before,
input[type="checkbox"]:checked + label:before {
content: '\f383';
font-family: 'Ionicons';
font-size: 24px;
width: 26px;
height: 20px;
text-align: center;
display: table-cell;
padding: 0 2px;
border: 2px solid #45555F;
color: #8ec549;
}

input[type="radio"] + label:before {
border-radius: 50% !important;
}

我还注意到 Internet Explorer 只是在加载时删除了样式...

enter image description here

感谢您的帮助!

编辑:Codepen 演示(该演示在 IE 中也不起作用)

http://codepen.io/anon/pen/rLJqyK

最佳答案

与在选中时修改 :before 伪元素相反,我只是将 :after 伪元素用于事件状态,并在不透明度之间轻弹以相应地隐藏和显示它们.

感谢所有提供帮助的人。

关于css - 未呈现 Internet Explorer 'input:checked + label:before' 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38461010/

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