liveBook · Manning

Chapter 16: Transforms

What you will learn in chapter 16 of CSS in Depth, Second Edition

Introduces CSS transforms as a way to change an element’s shape or position, often alongside transitions or animations.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces CSS transforms as a way to change an element’s shape or position, often alongside transitions or animations.

Key terms: transform property, transforms, transitions, animations

16.1 Rotate, translate, scale, and skew

This section introduces the four basic CSS transforms, shows how their values affect a card, and explains two constraints on using them.

Key terms: transform property, rotate(), translate(), scale(), skew(), document flow, translate, margin, inline elements, inline-block

16.1.1 Changing the transform origin

Explains how the transform origin anchors rotation, scaling, and skewing, and how to change its position.

Key terms: transform origin, translate(), transform-origin, center, percentages

16.1.2 Applying multiple transforms

This section explains how multiple CSS transforms are applied and why their order affects the direction of translation.

Key terms: transform property, translate(), rotate(), scale(), source order

16.1.3 Individual transform properties

This section introduces individual CSS transform properties, explains their fixed application order, and compares when to use them instead of the transform property.

Key terms: translate, rotate, scale, skew, individual transform properties, transform property

16.2 Transforms in motion

This section sets up a responsive icon-and-label navigation menu and explains why transforms will be paired with motion in the effects added next.

Key terms: transforms, motion, skew(), nav, SVG, Scalable Vector Graphics, icon image, text label, mobile-first, flexbox

16.2.1 Scaling up the icon

The section shows how to enlarge a navigation icon without shifting nearby content and explains why SVG is well suited to icons that change size.

Key terms: scale transform, transition, hovered, focused, document flow, SVG, <img>, inline, CSS, pixelation

16.2.2 Creating “fly in” labels

This section shows how menu labels can fade and slide into view on hover or keyboard focus, with a subtle bounce at the end.

Key terms: opacity, translate, transition, :hover, :focus-within, nav-links, cubic-bezier(), bounce effect

16.2.3 Staggering the transitions

This subsection uses position-based transition delays to make menu items fly in one after another and notes the maintenance limit of that approach.

Key terms: transition-delay, stagger, :nth-child(), selectors, menu items

16.3 Animation performance

This section explains why transforms are generally preferable to positioning or explicit sizing when animating elements.

Key terms: transforms, translate, scale transform, relative positioning, left property, transitions

16.3.1 Looking at the rendering pipeline

This section explains how the browser’s rendering pipeline affects animation performance and when to use `will-change`.

Key terms: rendering, layout, paint, composite, reflow, background color, opacity, transform properties, paint layer, GPU acceleration

16.4 3D transforms

This section extends familiar 2D transforms to translation and rotation along the x, y, and z axes.

Key terms: translate(), translateX(), translateY(), translateZ(), translate property, z dimension, rotate(), rotateX(), rotateY(), rotateZ()

16.4.1 Controlling perspective

This section explains how perspective gives 3D transforms visible depth and how to apply it to individual elements or a shared scene.

Key terms: perspective, 3D scene, perspective distance, perspective() transform, perspective property, common ancestor, vanishing point, perspective(), transform declaration, individual transform properties

16.4.2 Implementing advanced 3D transforms

This section explains three CSS properties that refine how 3D-transformed elements are viewed and rendered.

Key terms: perspective-origin, perspective, backface, backface-visibility: hidden, rotateY(), transform-style: preserve-3d, parent element, nested elements

16.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 15: Transitions Chapter 17: Animations →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.