CSS Transform

This YouTube video was created by Steve Griffith.

CSS has a variety of styles that can be animated. Some properties when animated can leverage the graphics card to improve performance. In a later chapter we will use transform: translate(x,y) to move an element left to right instead of using the left CSS property. Let's take a look at some of the ways we can animate elements with the transform property.

transform: rotate(#deg)

transform rotate()

360deg = 1 rotation right, -360deg = 1 rotation left,  1080deg = 4 rotations right

transform: skew(x-angle,y-angle)

transform: scale(#)

Shrink and grow contents inside box.

Multiple transforms

In this example we will use both the scale and rotate transform to grow and spin the box.