Interactive online courses HTML Academy
2026-03-09 10:59 Diff

Smooth transitions and animations can only be applied to some CSS properties. Basically, these are properties that change the size, color, and position of elements. The article on MDN provides a list of animated properties and the nature of their animation.

If only the transition-duration is set, then the smooth transition will affect all properties of the element and will be applied simultaneously for all properties by default.

Let’s try setting a few more properties for the button and see how they change.

CSS transforms are used in this and the following examples, which are covered in detail in the “2D transforms” chapter.