San*_*thi 2 javascript css radio-button internet-explorer-8
我的收音机按钮很少.我使用以下css来更改带图像的单选按钮样式.它在firefox,chrome甚至Internet Explorer 9中都能很好地工作,但在Internet Explorer 8中却不行.
input[type='radio'] + label {
margin: 0;
clear: none;
padding: 5px 0 4px 24px;
/* Make look clickable because they are */
cursor: pointer;
background: url(icons.png) left center no-repeat;
background-position:0px -7055px; width:45px; height:20px; border:0px; cursor:pointer
}
input[type='radio']:checked + label {
background-image: url(icons.png);
background-position:-54px -7055px; width:45px; height:20px; border:0px; cursor:pointer
}
Run Code Online (Sandbox Code Playgroud)
该:checked伪类不可用IE8
http://www.quirksmode.org/css/contents.html
http://www.quirksmode.org/css/enabled.html
我只是在IE8及更低版本中显示正常的单选按钮.这为拥有旧技术的人们提供了相同的体验,并且不会给您带来数小时/天的工作负担,只是为了让所有浏览器看起来都一样.
| 归档时间: |
|
| 查看次数: |
11232 次 |
| 最近记录: |