The default width / height of the div is auto and, as such, will not animate.
input has a default width / height and, as such, will animate.
As a side note, the transition does work on the div , although it only animates its color, since you can animate the color from transparent to blue
You should also consider not using all with transition , as this can give unpredictable results due to this fact that browsers set some element values โโto the default value, where some can be animated, some cannot.
So, in your case, if you intend to animate the width / height, configure it like this: transiton: width 2s ease, height 2s ease;
LGSon source share