Use the translateX(x) method to transform the element using x-axis.
Let us see the syntax
translateX(x)
Here,
- x: It is a length representing the abscissa of the translating vector.
Let us see an example
div {
width: 40px;
height: 40px;
background-color: black;
}
.trans {
transform: translateX(20px);
background-color: orange;
}