translateY() CSS Function
Description
The translateY() CSS function is a 2D transformation function that moves an element along the vertical axis. Unlike the translate() function, which can move an element in both X and Y directions, translateY() focuses solely on the Y-axis, shifting the element up or down relative to its current position without affecting the layout of surrounding elements. This movement is relative to the element’s current position in the document flow and does not change the space the element originally occupies, making it a non-disruptive transformation.
The function accepts values in various units such as pixels (px), percentages (%), em, rem, or viewport units. Positive values move the element downward, while negative values move it upward. For example, translateY(50px) moves the element 50 pixels down from its original position.
Using translateY() in combination with transition can create smooth animations. For instance, you can make a div slide in from above on hover:
div {
transform: translateY(-100%);
transition: transform 0.5s ease-in-out;
}
div:hover {
transform: translateY(0);
}
This example demonstrates how the element initially sits above its normal position and smoothly slides down into view when hovered. Because translateY() does not impact the document flow, adjacent elements remain unaffected, unlike when using top or margin adjustments.
translateY() is widely used for UI animations such as tooltips, modals, dropdowns, and interactive hover effects, providing a performance-friendly alternative to positional shifts.
Syntax
transform: translate(ty);
Values
- tyVertical shift. A positive value moves up, a negative value down.
Example
Browser Support
The following information will show you the current browser support for the CSS translateY() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
This function is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
