translateZ()

The CSS translateZ() function adds depth to an element, drawing it closer or farther in space. In other words, it shifts an element along the Z-axis in a 3D space. .box:hover { transform: translateZ(100px); } .box.perspective:hover { transform: perspective(500px) translateZ(100px); } Either Read more…

translateY()

The CSS translateY() function shifts an element vertically by the specified amount. Specifically, it shifts an element either up or down, depending on whether the value is positive or negative. .parent:hover .box { transform: translateY(50%); /* Shift down by half the element’s Read more…

translateX()

The CSS translateX() function shifts an element horizontally by the specified amount. Specifically, it displaces an element to the right or the left, depending on whether the value is positive or negative. .parent:hover .box { transform: translateX(50%); } CodePen Embed Fallback Along Read more…

translate()

The CSS translate() function shifts an element from its default position on a two-dimensional plane. This way, we can reposition an element horizontally, vertically, or both. .parent:hover .box { transform: translate(50px, 50%); } Hover over the box to see it move 50% Read more…