【发布时间】:2016-11-22 11:52:39
【问题描述】:
我在为我的自定义复选框设置 :checked 样式以在 Internet Explorer 中显示时遇到了一些问题。
它们在 Chrome 中运行良好。
...但在 IE 中
这是相关的样式
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 只是在加载时删除了样式...
感谢您的帮助!
编辑:Codepen 演示(此演示也不适用于 IE)
【问题讨论】:
-
什么是IE版本?
-
问题中的图片是IE11,但是IE10也出现了问题!
-
最好的办法是创建一个可运行的 HTML sn-p,我们可以在其中检查问题
-
@JuanMendes 我已经用 Codepen 演示更新了这个问题。
-
您的 codepen 在 IE11 中为我工作(我看到绿色复选标记)。
标签: css internet-explorer checkbox css-selectors pseudo-element