我有一些滑动门按钮 css。我使用一个按钮标签和两个内部跨度。
我有这个来指定普通按钮的背景图像;
button span {
background: url(button_right.png) no-repeat top right;
}
这是默认按钮颜色。然后我有一个“灰色”按钮(我给按钮一个“灰色”类)。
button.gray span {
background: url(button_right_gray.png) no-repeat top right;
}
出于某种原因.. IE(8) 不喜欢这样,并忽略了保留原始图像作为背景的灰色 css。但是,以下“悬停”css 在 IE 中有效;
button.gray:hover span span {
color: #6c6c6c;
background-position: left -29px;
}
我认为'button.gray span'比'button span'具有更高的特异性(它在所有其他浏览器中都有)。
编辑:好的,所以我发现了问题。在我的 CSS 声明中,我有以下内容
button.gray span,
button:disabled span {
background: url(button_right.png) no-repeat top right;
}
如果我从声明列表中删除 button:disabled span,它可以工作!