translateX() CSS Function


The translateX() CSS function shifts the element relative to its original location by a given horizontal value.


transform: translate(tx);


  • txHorizontal shift. A positive value shifts to the right, a negative value to the left.
Any length units accepted in CSS are accepted as values ​​- for example, pixels (px), inches (in), points (pt), etc. A positive value shifts to the right, negative to the left. A value of 0 does not change the position of the element.


<img class="translate" src="images/nature.jpg" alt="Nature Image">
.translate {
transform: translateX(80px);

Browser Support

Explorer Edge Chrome Firefox Opera Safari
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung

Last updated by CSSPortal on: 1st December 2019