Doing a simple CSS animation to increase height
of a div
using transition: all
and a question came up. See the example:
div{
width: 100px;
height: 30px;
background: red;
transition: all 1s ease;
}
div:hover{
height: 100px;
}
<div>Passe o mouse</div>
I could use transition: height
, since I just want to apply the transition in height
, but also using all
the result is the same, since all
will apply the effect to any changed property (provided ownership is supported).
So, is not it better to always use all
since it takes all properties? Using all
implies some disadvantage in using a specific property in transition
(such as height
, width
, background-color
etc.)? If this is indifferent, why not only use all
in any case?