CSS转换在Safari中不起作用 [英] css transitions not working in safari
问题描述
如果您查看我的页面 http://debourg-dev.ch/crea/会看到对我的链接的过渡效果在Safari中不起作用(已在Mac的最新版本上进行了测试).我的代码如下:
If you look at my page http://debourg-dev.ch/crea/ you will see the transition effects on my links don't work in safari (tested on latest version on mac). My code is the following:
a {
color: inherit;
text-decoration: none;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
出什么问题了?
推荐答案
似乎Safari在 transition:all;
(或者仅仅是 transition:Xs;
>,因为"all"是默认属性).甚至会使某些版本的台式机和iOS Safari崩溃.
It seems Safari has a bug and chokes on transition: all;
(or just transition: Xs;
because 'all' is the default property). It even crashes some versions of desktop and iOS Safari.
解决方案:将其更改为 transition:颜色0.5s缓入;
(或者,当然还有其他任何属性,只需确保它不是全部"即可.)
SOLUTION: Change it to transition: color 0.5s ease-in-out;
(Or, of course any other property, just make sure it's not 'all'.)
专门将转换全局应用于锚标记也可能是一个问题-阅读更多此处
It could also be a problem specifically with the transition being applied globally to anchor tags - read more here
有关Safari的更多信息崩溃
More about Safari crashing
并且此处
这篇关于CSS转换在Safari中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!