gpt4 book ai didi

css3 变换图像悬停在 firefox 中

转载 作者:太空宇宙 更新时间:2023-11-04 15:26:10 25 4
gpt4 key购买 nike

    .mark.studio{
background: url(../images/studio_icon.png) no-repeat;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
height: 50px;
width: 50px;
z-index:103 !important;
}

.mark.studio:hover{
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
background: url(../images/studio_icon-hover.png) no-repeat;
z-index:103 !important;

}

在悬停时使用此 css,图像从原始图像变形为悬停图像,从而产生非常酷的效果,在 firefox 和 IE9 中,我只是获得了悬停图像替换。我将 -webkit-transition 放在两个选择器中,但我很确定它只需要在马克工作室

最佳答案

指定transition的无前缀版本; Firefox 和 Internet Explorer 删除了前缀。 (请注意,它是 Internet Explorer 10;IE9 不支持 transition。)

.mark.studio {
background: url(../images/studio_icon.png) no-repeat;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
height: 50px;
width: 50px;
z-index: 103 !important;
}

.mark.studio:hover {
background-image: url(../images/studio_icon-hover.png);
}

我冒昧地将 z-indextransition:hover 状态中移除;再次添加它们毫无意义。 (除非您有另一个覆盖它的 z-index!important,这将是一个非常糟糕的设计。)

关于css3 变换图像悬停在 firefox 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14016087/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com