我正在使用 asp.net mvc4。当我将鼠标悬停在按钮上时,颜色没有改变。它始终显示按钮上的默认蓝色焦点。谁能告诉我如何解决这个问题。我正在使用 ie8。
view :
<input type="button" class="dynamicButton" value="button" id="btnSearch"/>
css:
.dynamicButton
{
height: 25px;
width:auto;
min-width: 11%;
}
.dynamicButton:hover
{
background-color:#4F2D7F;
color:white;
}
我加了
<!doctype html>
添加到我的代码中,但添加后我的页面布局发生了变化。
最佳答案
IE(不确定是哪个版本),当处于怪癖模式时,除了 anchor 之外不会触发悬停状态。您需要 指定文档类型(不需要是 <!doctype html>,其他人会这样做)以将其转换为标准模式。如果实现文档类型会扰乱您的布局,从长远来看,您最好修复布局问题。
这是一个讨论如何让 IE 进入标准模式的相关问题:How do I force Internet Explorer to render in Standards Mode and NOT in Quirks?
关于html - 鼠标悬停在按钮上在 ie8 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20841404/