Your .div
and .divanimated
selectors have the same specificity. Because the .div
style is specified after the .divanimated
selector it will override all the similar attributes such as animation-name
.
For this example, you could fix the problem by adding the div
class to the .divanimated
selector.
Your new CSS selector (line 1 of your CSS) would be:
.div.divanimated
solved Start a Animation when I press a Button doesn’t work