Course Recommendation:
- Página anterior pageBreakInside
- Página siguiente perspectiveOrigin
- Volver a la capa superior Objeto Style de HTML DOM
Style perspective property
Note: When defining the
Definition and Usage
property, it defines the distance of the 3D element from the view in pixels. This property allows you to change the perspective of viewing 3D elements. Note: When defining the
When defining
property, its child elements will receive the perspective effect instead of the element itself.Note: When defining the
perspective
The property only affects 3D transform elements.Tip: perspective-origin property Use this property together to change the bottom position of 3D elements.
See also:
JavaScript Style Object:perspectiveOrigin property
CSS Reference Manual:perspective property
Example
Set the view angle of the viewing element:
document.getElementById("myDIV").style.perspective = "50px";
Syntax
Return perspective property:
object.style.perspective
Set perspective property:
object.style.perspective = "length|none"
Property Value
Value | Description |
---|---|
length | The distance of the element from the view, in pixels. |
none | Default Value. Same as 0. No perspective. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical Details
Default Value: | None |
---|---|
Return Value: | A string representing the element's perspective property. |
CSS Version: | CSS3 |
Browser Support
The numbers in the table indicate the first browser version to fully support this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
36.0 | 10.0 | 16.0 | 6.1 | 23.0 |
- Página anterior pageBreakInside
- Página siguiente perspectiveOrigin
- Volver a la capa superior Objeto Style de HTML DOM