HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

CSS 3D Transforms

CSS 3D Transforms are a set of CSS properties that enable developers to manipulate the position, rotation, scale, and perspective of elements in 3D space within a web page. These transformations allow for creating visually engaging and interactive effects, such as rotating, scaling, or moving elements in three dimensions.

CSS 3D Transforms Methods

This property is used to apply various transformations to an element. With 3D transforms, you can use functions like rotateX, rotateY, rotateZ, scaleX, scaleY, scaleZ, translateX, translateY, translateZ, skewX, and skewY to manipulate the element in 3D space.

The rotateX() Method

Example

    Div {
  transform: rotateX(150deg);
}
You can click on above box to edit the code and run again.

Output

This a normal div element.
This div element is rotated 150 degrees.

The rotateY() Method

Example

     Div {
  transform: rotateY(150deg);
}
You can click on above box to edit the code and run again.

Output

This a normal div element.
This div element is rotated 150 degrees.

The rotateZ() Method

Example

    Div {
  transform: rotateZ(90deg);
}
You can click on above box to edit the code and run again.

Output

This a normal div element.
This div element is rotated 150 degrees.

With CSS 3D Transforms, developers can create effects like rotating elements in 3D space, flipping elements to reveal content on the other side, creating 3D card stacks, and building immersive user interfaces. These techniques can enhance the visual appeal and interactivity of web pages without relying on JavaScript or external libraries.