From the course: CSS: Transforms and Transitions

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Multiply matrix transformations

Multiply matrix transformations - CSS Tutorial

From the course: CSS: Transforms and Transitions

Start my 1-month free trial

Multiply matrix transformations

- [Instructor] Okay, I confess, I'm not done with matrices quite yet. We saw in that earlier video that we can combine CSS transforms by applying the transformation options in a space separated list. The same thing can be done with matrix transformations, though with matrix transformations, you have to multiply the matrices in the order in which the effects are applied. For example, here's a multiplication of three transformation matrices. The first matrix rescales the figure, the second matrix skews it, and the third matrix translates it 40 pixels to the left and 50 pixels down. Let's use the demo to multiply these three matrices and apply them to the image. So here's the result of multiplying the three matrices. This is what the matrix function will look like and here's the resulting image. But order is important with transformations. So here are the three matrices again but arranged in a different order. So let's multiply them together. I end up with this matrix transformation…

Contents