gpt4 book ai didi

css - :hover is not working properly in IE9

转载 作者:技术小花猫 更新时间:2023-10-29 10:28:08 24 4
gpt4 key购买 nike

我有一个简单的 CSS 下拉菜单,里面有一个 iframe。当我将鼠标悬停在下拉菜单上时,菜单会下拉。但是当我的鼠标悬停在菜单内的 iframe 上时,菜单会返回。这是我的代码的简化版本:

<div id="comments">
<a href="#" class="btn">View comments</a>
<div id="comment-wrap">
<iframe src="http://www.facebook.com/plugins/comments.php?..."></iframe>
</div>
</div>

<style type="text/css">
#comment-wrap{display:none;z-index:5;position:absolute;padding:10px;background-color:#fff;}
#comments:hover #comment-wrap{display:block;}
</style>

这适用于最新版本的 FF、Chrome 和 Opera。

附言当我的鼠标悬停在#comment-wrap 的填充处时,下拉菜单保持下拉状态。

最佳答案

我在使用 :hover psuedo 类时遇到过类似的问题。当我将浏览器的文档模式更改为 IE 9 并且浏览器模式也设置为 IE9 时,它开始正常工作。 IE 9 默认将文档模式设置为 IE8。

此外,您可以在head标签中添加以下元信息:

<meta http-equiv="X-UA-Compatible" content="IE=9"/>

希望这对您有所帮助。

关于css - :hover is not working properly in IE9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6619156/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com