Understanding CSS Transforms
- Understand what CSS Transforms are
- Learn to Apply 2D CSS Transforms
- Work with best practices for 2D CSS Transforms
Introduction to CSS Transforms
What are CSS Transforms?
The CSS transform property was a part of the first draft of the CSS3 Animations specification that was introduced by the W3C on March 20, 2009.1 Transforms can be applied in both the 2D and 3D spaces.
Transforms are like snapshots of where an object is or how it looks at a given moment in time rather than the object fluidly going from one point to another point. They're a great place to start our journey of learning animation together.
"The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model."2
Transforms are like snapshots of where an object is or how it looks at a given moment in time rather than the object fluidly going from one point to another point.
Let's look at the different types of 2D transforms that can be used: rotate, scale, skew, translate, transform-origin, and transform style.
- Jackson, Dean, et al. “CSS 3D Transforms Module Level 3.” CSS 3D Transforms Module Level 3, Word Wide Web Consortium (W3C), 20 Mar. 2009, https://www.w3.org/TR/2009/WD-css3-3d-transforms-20090320/.
- “Transform - CSS: Cascading Style Sheets: MDN.” CSS: Cascading Style Sheets | MDN, MDN Web Docs, https://developer.mozilla.org/en-US/docs/Web/CSS/transform.