我有这些与内部类的链接
<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 标签有关?
最佳答案
你有<!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/