CSS Hover 不能在 IE i 标签中工作

标签 css internet-explorer hover

我有这些与内部类的链接

<a href="#"><i class="icon-instagram"></i></a>

现在我已经这样设计了它们

.top-social-icons a i.icon-instagram{
    background:#DB97BE;
    padding:7px;
    transition-duration:800ms;
    transition-property: width, background;transition-timing-function:ease;
}

.top-social-icons a i.icon-instagram:hover{
    background:transparent;
    transition-duration:800ms;
    transition-property: width, background;
    transition-timing-function:ease;
}

在除 IE 之外的所有浏览器中都可以正常工作 我一直在为此绞尽脑汁。对不起,如果我张贴到马虎这只是我第二次在这里发帖。我假设它与包装在 a 标签中的 i 标签有关?

link to site

最佳答案

你有<!doctype html>吗? decleration 在你的 html 页面的顶部?来自 w3Schools即在使用 :hover 时需要它a 以外元素的伪类s(你在 i 标签上使用它)

Note: In IE there must be declared a <!DOCTYPE> for the :hover selector to work on other elements than the <a> element.

关于CSS Hover 不能在 IE i 标签中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20876116/

相关文章:

internet-explorer - GWT 对话框中 Internet Explorer 上的 Google Maps Transparant 磁贴

css - 悬停 :before set content in two lines?

html - 悬停剪辑不工作

css - 如何在 webpack 中编译样式

javascript - 设置一个div来显示:none; using javascript or jQuery

javascript - 如何断言 HTML 元素在包含样式表后不会改变其外观?

html - 无法水平居中图像

css - float 元素在 IE7 中中断,在 IE8+ 中工作

java - Spring Framework MVC 中的 "Webpage has expired"

html - 下拉菜单中的样式悬停状态(PayPal)