css - 带有 anchor 标记的 Internet Explorer CSS

标签 css internet-explorer google-chrome hover anchor

我正在查看此站点上的一些帖子,但仍然找不到解决方案。
这是我的 HTML:

<div id="id1">
  <div id="id2">
    <div id="id3">
      <a id="id4" class="divItem">
        text
      </a>
    </div>
  </div>
</div>

和CSS:

#id1 {
width:960px;
margin:auto;
}

#id2 {
position:relative;
font-family:Calibri;
}

#id3 {
float:right;
position:relative;
margin-bottom:10px;
font-size:12px;
color:#5E666D;
}

.divItem {
float:left;
margin-right:10px;
}

a.divItem:hover {
color:#AD8E5A;
font-size:11px;
}

但是 divItem 上的悬停不会出现在 internet explorer 中,只会出现在 safari 和 firefox 以及 chrome 中。

最佳答案

Internet Explorer 6 只能在具有 href 属性的 a 元素上解释 :hover。您缺少该属性。

有一个 fix这使得 :hover 像在其他浏览器中一样工作。

关于css - 带有 anchor 标记的 Internet Explorer CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4086583/

相关文章:

javascript - JQuery scrollTop 在 Chrome 中导致问题

google-chrome - 在 Google Chrome 开发者工具的网络选项卡中捕获下载

google-app-engine - 为什么 dev_appserver.py(App Engine 开发服务器)挂起等待请求?

html - 如何在 GWD 中将自动生成的 CSS 代码与 HTML 文件分开?

javascript - Intranet 站点的 IE9 兼容模式具有错误的用户代理字符串

html - 在我的标题中看不到 Bootstrap-hamburger-menu 图标,并且部分导航列表元素最终位于 Logo 图像下

javascript - 使用 jQuery 无法动态添加多个元素

javascript - Videojs 无法在 IE 9 及更高版本中工作

css - 页面末尾错误 (XML SVG) & CSS 不工作

css - 基础中样式特定的工具提示弹出窗口