Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear CSS Transitions

I use a CSS framework which applies transitions on moving the mouse over input elements. I have a class which I want to not have this transition. Is this possible?

like image 746
JJJollyjim Avatar asked May 17 '12 05:05

JJJollyjim


People also ask

How do I change a transition to none in CSS?

Even better than setting transition-property to none is setting transition-duration to 0s. This is the cross-browser code: -webkit-transition-duration: 0s; -moz-transition-duration: 0s; -o-transition-duration: 0s; transition-duration: 0s; Why is this better?

How do I turn off transition in CSS?

The specific adaptation to Opera is the use of -o-transition: color 0 ease-in; which targets the same property as specified in the other transition rules, but sets the transition time to 0 , which effectively prevents the transition from being noticeable.

How do you get rid of transition properties?

To remove a transition, select Transitions > None.


1 Answers

Just put transition:none; in the css and make its priority higher than the others.

Example:

html:

<div class="a"></div>
<div class="a b"></div>

​ css:

div.a {
    width: 200px;
    height: 100px;
    border: 1px solid black;
    background-color: #EEE;
    -webkit-transition: background-color 0.5s;
}
div.a:hover {
    background-color: #069;
}
div.a.b {
    -webkit-transition: none;
}​
like image 96
rhgb Avatar answered Sep 30 '22 06:09

rhgb