CSSPerspective: CSSPerspective() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The CSSPerspective() constructor creates a new CSSPerspective object representing the perspective() value of the individual transform property in CSS.

Syntax

js
new CSSPerspective(length)

Parameters

length

A value for the distance from z=0 of the CSSPerspective object to be constructed. This must be a <length>.

Exceptions

TypeError

Raised if the value of CSSPerspective.length exists but is not a <length>.

Examples

To do

Specifications

Specification
CSS Typed OM Level 1
# dom-cssperspective-cssperspective

Browser compatibility

BCD tables only load in the browser