我正在尝试使用此css
更改按钮的样式input[type=submit] {
color: #FFFFFF;
background: #94B5CF;
border: 1px solid #739BBF;
float: right;
}
input[type=submit]:hover {
background: #A4C1D8;
border: 1px solid #7FA5C6;
}
除了在Internet Explorer 8中,它在所有其他浏览器上都能正常工作。我的意思是它有效但不正确,就像我将鼠标悬停在按钮上它会改变颜色但只有几分之一秒然后恢复到正常状态
另一个奇怪的事情是,如果我没有将按钮浮动到右侧,它在IE8中工作正常。答案 0 :(得分:3)
尝试使用input[type="submit"]
(在引号中)
答案 1 :(得分:1)
你是否处于Quirks模式?添加
<!DOCTYPE html>
到html,使其进入标准模式。
<强>更新强>
如果它处于标准模式,它可以起作用!
csshover.htc会修复它。
如果您的主机没有htc文件的mimi类型,请使用php包装器。
<?php
header( 'Content-type: text/x-component' );
include( 'csshover.htc ' );
?>
然后使用
myElement, .myClass, #myID {
[ ...css3 rules... ]
behavior: url(myphp-csshover.php);
}
而不是
myElement, .myClass, #myID {
[ ...css3 rules... ]
behavior: url(csshover.htc);
}