{"id":17444,"date":"2012-07-09T12:16:45","date_gmt":"2012-07-09T19:16:45","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=17444"},"modified":"2021-08-04T08:31:53","modified_gmt":"2021-08-04T15:31:53","slug":"perspective","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/p\/perspective\/","title":{"rendered":"perspective"},"content":{"rendered":"\n

The perspective<\/code> CSS property gives an element a 3D-space by affecting the distance between the Z plane and the user.<\/p>\n\n\n\n

The strength of the effect is determined by the value. The smaller the value, the closer you get from the Z plane and the more impressive the visual effect. The greater the value, the more subtle will be the effect.<\/p>\n\n\n\n

Important:<\/strong> Please note the perspective property doesn’t affect how the element is rendered; it simply enables a 3D-space for children elements. This is the main difference between the transform: perspective()<\/code> function and the perspective<\/code> property. The first gives element depth while the later creates a 3D-space shared by all its transformed children.<\/p>\n\n\n\n

.parent {\n  perspective: 1000px;\n}\n\n.child {\n  transform: rotateY(50deg);\n}<\/code><\/pre>\n\n\n\n