IE 8 CSS hover over input element issue(IE 8 CSS 悬停在输入元素问题上)
问题描述
我的问题:
下面的代码在 FireFox 和 Google Chrome 中适用于我,但在 IE 中,按钮不会改变颜色.有人可以告诉我如何解决这个问题.有什么建议?我的输入元素:
The code below works for me in FireFox and Google Chrome, but in IE the button does not change colors. could someone show me how I can fix this issue. Any Suggestions? My input element:
<input id="pmunch" type="submit" value="Post It!"/>
与该元素相关的 CSS:
The CSS relevant to this element:
#pmunch{
width:240px;
height:28px;
padding:2px 4px;
margin-left:24px;
font-family:‘Lucida Console’, Monaco, monospace;
font-size:18px;
border:none;
float:left;
background-color:turquoise;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
#pmunch:hover{
background-color:khaki;
color:green;
cursor:pointer;
}
推荐答案
我注意到的一件事是,如果浏览器处于 quirks 模式(即:如果页面顶部没有 doctype 行), IE——甚至是 IE8——不喜欢 :hover 除了链接之外的任何东西.
One thing i've noticed is that if the browser is in quirks mode (ie: if you don't have a doctype line at the top of the page), IE -- even IE8 -- doesn't like :hover on anything but links.
即使是 <!DOCTYPE html>
也足以触发标准模式.如果它不存在,请添加它.
Even <!DOCTYPE html>
is enough to trigger standards mode. Add that if it isn't already there.
这篇关于IE 8 CSS 悬停在输入元素问题上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IE 8 CSS 悬停在输入元素问题上


- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01