Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Remove css3 transitions to child elements of div?

Tags:

html

jquery

css

Is it possible to remove child element transitions in CSS.

Here my problem is,

I have a div that consists of one H1 tag and one div (the div contains one P tag).

When I apply transition to parent div it's applying to the child elements also. But it is not needed.

How can I disable the transitions for child elements?

Here my parent div CSS code snippet:

-webkit-transition: width .75s ease;
   -moz-transition: width .75s ease;
     -o-transition: width .75s ease;
        transition: width .75s ease;

The transitions is applied when parent width changes.

like image 633
mani Avatar asked Feb 26 '14 00:02

mani


2 Answers

-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
-ms-transition: none;
transition: none;
like image 179
Jaron Gao Avatar answered Sep 24 '22 03:09

Jaron Gao


Apply a transition of 0s to all child elements.

.myElement *{
    -webkit-transition: width 0s;
       -moz-transition: width 0s;
         -o-transition: width 0s;
            transition: width 0s;
}
like image 30
Mooseman Avatar answered Sep 23 '22 03:09

Mooseman