【问题标题】:Internet explorer css with anchor tag带有锚标记的 Internet Explorer css
【发布时间】:2011-05-04 10:46:21
【问题描述】:

我正在查看此站点上的一些帖子,但仍然找不到解决方案。
这是我的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 中。

【问题讨论】:

    标签: css internet-explorer google-chrome hover anchor


    【解决方案1】:

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

    有一个fix 可以让:hover 像在其他浏览器中一样工作。

    【讨论】:

    • @Infinity 现在可以用了吗?我们谈论的是哪个版本的 Internet Explorer?你可以试试a#id4:hover吗?
    • 当你有额外的空间时,你的代码怎么可能在其他浏览器上工作?
    • @Fabrizio Calderan:这是可能的,因为额外的空间只在这里展示。很抱歉错过了主要职位。
    • 很好,Pekka 我自己也得出了这个结论,jsfiddle.net/Kyle_Sevenoaks/AzgHw
    • @Kyle 不错!这太奇怪了。我的意思是,如果没有其他浏览器关心,那么寻找 href 有什么意义?像这样的东西就是人们讨厌 IE 的原因。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-22
    • 1970-01-01
    • 2015-12-07
    相关资源
    最近更新 更多