asp.net.ph

Skip Navigation LinksAbakada: Back to Basics > Language References > CSS Properties > Transform Functions > translateX( ) Transform Function

translateX( ) Transform Function


Repositions an element in the horizontal and/or vertical directions.

Syntax:

{ transform: translateX( length ) }

Possible Values

x-length Required. Floating point number representing the horizontal coordinate.

Remarks:

The translateX( ) CSS function defines a transformation that repositions an element in a horizontal direction.

The coordinate defines how much the element moves.

A value of 0 leaves the input unchanged.

If positive, the movement will be clockwise. If negative, the movement will be counter-clockwise.

A percentage for horizontal translations is relative to the width of the reference box.

Example

The following example demonstrates the effects of applying the translateX( ) function to change an element’s position on the 2D plane.

 Show me 

For a brief overview, please see Understanding and Using CSS Transforms.

See Also

translate( ), translateY( )



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note