Order matters; the flow box does not move
.rotated-first { transform: translateX(3rem) rotate(45deg); }
.translated-first { transform: rotate(45deg) translateX(3rem); }The two lists swap function order, so they are not the same transform. Both elements still occupy their untransformed layout boxes in normal flow.
- The explanation describes the specified transform list and the normal-flow rule. It is not a screenshot of the two boxes.
<div class="stage">
<div class="box rotated-first">rotate first</div>
<div class="box translated-first">translate first</div>
</div>
<style>
.stage { width: 16rem; font-family: sans-serif; }
.box { width: 4rem; height: 4rem; margin-bottom: 2rem; background: #F3EFE4; border: 1px solid #0B5853; }
.rotated-first { transform: translateX(3rem) rotate(45deg); }
.translated-first { transform: rotate(45deg) translateX(3rem); }
</style>What this markup means
rotated-first applies rotate(45deg) first, then translateX(3rem) in the parent’s horizontal axis. translated-first applies translateX(3rem) first along the element’s x-axis, then rotates the result, so the translation moves diagonally. The margin-bottom: 2rem still collapses or separates the untransformed 4rem boxes; the visual rotation does not shrink that layout gap. Neighbours in normal flow are not reflowed to follow the painted square.
Related: Position (containing blocks), Box model