Web4College

CSS perspective property

src

Description

CSS perspective property esatablishes a new stacking context and allows the 3-D transformation of children elements. Remember that it applies to the transform children elements and not the element itself.

In the demo, we apply 'perspective' property to the element. But its effect is visible on the children elements.

Syntax

perspective : none | length

Property values

noneDefault

In this case, no perspective is applied.

perspective: none;
Try it

length

300

It translates the box by 50px along Y-axis.

perspective: 300px;
Try it

Applicable to

It applies to transformable elements.