Why does my transformed element overlap other elements without pushing them?
Transforms are applied in the paint phase, afterlayout is calculated. The element's original space in the document flow is preserved. A translated or scaled element is visually moved but its layout footprint stays at the original position. This is by design and is what makes transforms ideal for animation — no expensive reflows. If you need elements to actually reflow, use margin, padding, or change width/height instead.
What is the difference between transform: translate() and position: relative with top/left?
Both move an element visually without affecting siblings, but translate is GPU-composited (runs on the graphics card) while top/left triggers layout recalculation on the CPU. For animations, translate delivers smooth 60fps performance. Additionally, translate accepts percentage values relative to the element itself(translate(-50%, -50%) means “half my own width/height”), while top/left percentages are relative to the containing block. This self-referential sizing is what makes the centering trick work.
How do I create a smooth card flip animation?
Set the parent to perspective: 1000px. Create a wrapper with transform-style: preserve-3d and transition: transform 0.6s. Place two children (front and back) with backface-visibility: hidden, and rotate the back face 180deg by default. On hover, rotate the wrapper 180deg. The backface-visibility property hides the reverse side of each face, creating a clean card-flip illusion.