【发布时间】:2016-03-05 23:13:47
【问题描述】:
HTML:
<a class="navbar-brand page-scroll" href="#intro"></a>
CSS:
.navbar-custom .nav li a.navbar-brand {
width: 70px;
height: 62px;
background: url(myimg.png) no-repeat;
background-size: 70px 62px;
display: block;
position: relative;
text-indent: -9999px;
-webkit-transition: all .2s linear;
-moz-transition: all .2s linear;
-o-transition: all .2s linear;
-ms-transition: all .2s linear;
transition: all .2s linear;
}
.navbar-custom .nav li a.navbar-brand:hover {
background: url(myimghover.png) no-repeat;
}
悬停效果在每个浏览器中都可以正常工作,但过渡效果仅在 Google Chrome 中有效,我真的无法解释为什么。我已经尝试过使用精灵图像和伪元素悬停,但是我的图像具有透明背景,因此在悬停时,“底部”图像仍然部分可见。有什么想法吗?
提前谢谢你。 问候, J.
【问题讨论】:
标签: html css cross-browser css-transitions