将CSS3转换设置为none [英] Set a CSS3 transition to none
本文介绍了将CSS3转换设置为none的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何让CSS转换在媒体查询或其他情况下不起作用?例如:
How would I make it so a CSS transition doesn't work inside a media-query, or in any other case? For example:
@media (min-width: 200px) {
element {
transition: width 1s;
}
}
@media (min-width: 600px) {
element {
transition: none; // SET TO NO TRANSITION
}
}
推荐答案
您可以将 transition-property 设置为无。这样,不会应用过渡效果。
You can set the transition-property to none. This way, no transition effect will be applied.
像这样:
-webkit-transition-property: none;
-moz-transition-property: none;
-o-transition-property: none;
transition-property: none;
这篇关于将CSS3转换设置为none的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文