首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Css禁用背景图像动画

问Css禁用背景图像动画
EN

Stack Overflow用户
提问于 2016-08-18 07:34:33
回答 1查看 2.3K关注 0票数 1

我已经创建了简单的按钮,使用正常和悬停状态的2个背景图像。问题是,我测试过的每个浏览器都会在悬停时显示图像动画,就像上/下滑动一样。我已经删除了每一个css文件链接的顺序,以消除这个问题,但没有运气

如果我这样做:

代码语言:javascript
复制
* {

    /*CSS transitions*/
    -o-transition-property: none !important;
    -moz-transition-property: none !important;
    -ms-transition-property: none !important;
    -webkit-transition-property: none !important;
    transition-property: none !important;
    /*CSS transforms*/
    -o-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    -webkit-transform: none !important;
    transform: none !important;
    /*CSS animations*/
    -webkit-animation: none !important;
    -moz-animation: none !important;
    -o-animation: none !important;
    -ms-animation: none !important;
    animation: none !important;
    }

这个问题已经解决了,但我仍然希望能够在某些元素上使用过渡和动画。有没有办法只禁用背景图像的过渡?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-18 07:36:48

代码语言:javascript
复制
.no-animate {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
-o-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
-webkit-transform: none !important;
transform: none !important;
/*CSS animations*/
-webkit-animation: none !important;
-moz-animation: none !important;
-o-animation: none !important;
-ms-animation: none !important;
animation: none !important;
}

将该类应用于要禁用其转换的任何项目。不要在具有背景图像转换的元素上使用它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39007800

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档