Which of the following transform property value defines a perspective view for a 3D transformed element?

perspective3d(n)
perspective(n,n,n)
perspective(n)
none of the mentioned

The correct answer is: B. perspective(n,n,n)

The perspective property defines a perspective view for a 3D transformed element. It takes three arguments:

  • n: The distance from the viewer to the near plane.
  • n: The distance from the viewer to the far plane.
  • n: The field of view in degrees.

The near and far planes define the extent of the 3D scene. The field of view defines how much of the scene is visible.

For example, the following code defines a perspective view with a near plane of 1, a far plane of 100, and a field of view of 60 degrees:

transform: perspective(1, 100, 60deg);

The perspective3d property is a deprecated alias for the perspective property. It should not be used in new code.

The perspective property is supported by all major browsers.