Alex Rivera | Logout

How to best set a CSS3 transition to none?

Asked 2012-08-07T14:57:55.860
42

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
    }   
}
Edit
Report

1 Answer

74

You can set the transition-property to none. This way, no transition effect will be applied.

Like this:

-webkit-transition-property: none;
-moz-transition-property: none;
-o-transition-property: none;
transition-property: none;
answered 2012-08-07T17:34:20.440

Your Answer