CSS perspective-origin
The perspective-origin property in CSS is used to set the position at which the viewer is looking at the 3D element. It specifies a point in 3D space from where the viewer is looking at the 3D element.
The perspective-origin property takes two values: x-axis and y-axis. These values are used to determine the position of the 3D element relative to the viewer.
By default, the perspective-origin is set to center for both the x-axis and y-axis. This means that the viewer is looking directly at the center of the 3D element.
Let's take a look at how we can use the perspective-origin property in CSS with some examples.
In the example above, we have a div element that is rotated 45 degrees along the y-axis. The perspective-origin is set to 50% 50%, which means that the viewer is looking at the center of the 3D element.
If we change the perspective-origin values, we can see how it affects the position of the 3D element relative to the viewer.
In this example, the perspective-origin is set to 0% 0%, which means that the viewer is looking at the top-left corner of the 3D element. This changes the perspective of the viewer and affects how the 3D element is perceived.
Experiment with different values for the perspective-origin property to see how it affects the position of the 3D element relative to the viewer.