Transform the element along with x-axis using CSS



Use the translateX(n) method to transform the element along with x-axis.

Let us see the syntax

translateX(n)

Here, n is a length representing the abscissa of the translating vector.

Let us see an example

div {    width: 50px;    height: 50px;    background-color: black; } .trans {    transform: translateX(20px);    background-color: orange; }
Updated on: 2020-06-20T14:47:05+05:30

316 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements