VOOZH about

URL: https://www.geeksforgeeks.org/css/css-translatex-function/

⇱ CSS translateX() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CSS translateX() Function

Last Updated : 7 Jun, 2023

The translateX() function is an inbuilt function which is used to reposition the element along the horizontal axis. 

Syntax:

translateX( t )

Parameters: This function accepts single parameter t which holds the length of translation corresponding to x-axis. Below examples illustrate the translateX() function in CSS: 

Example 1: 

Output:

 👁 Image
 

Example 2: 

Output:

 👁 Image
 

Supported Browsers: The browsers supported by translateX() function are listed below:

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 9
  • Firefox 3.5
  • Safari 3.1
  • Opera 10.5
Comment
Article Tags: