我正在为我的 radio 做一个图像替换,它在 IE 中本地工作(只需打开 html 页面),在 IE 中的 WAMP 上以及在 IE 中在线的我的 Linux 服务器上工作,但不能在我的内部 IIS 上工作7 服务器。适用于 IIS 服务器上的 Chrome,但不适用于 IE。
HTML
<input id='Good' type='radio' class='css-checkbox'name='value' value='1'/>
<label id='1' class='css-label' for='Good'> Good </label>
CSS
input[type=radio].css-checkbox {
margin: 10px;
display:none;
}
input[type=radio].css-checkbox + label.css-label {
padding-left:27px;
height:22px;
display:inline-block;
line-height:22px;
background-repeat:no-repeat;
background-position: 0 0 !important;
vertical-align:middle;
cursor:pointer;
}
label.css-label {
margin: 10px;
background-image:url(../images/radio.png);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
input[type=radio].css-checkbox:checked + label.css-label{
background-position: 0 -22px !important;
}
最佳答案
所以这是一个兼容性 View 问题。我进入“兼容性 View 设置”并取消选中“在兼容性 View 中显示 Intranet”。现在工作正常。
关于html - CSS :checked doesn't work in IE on IIS 7 server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22843320/