{"id":320275,"date":"2020-09-09T07:29:09","date_gmt":"2020-09-09T14:29:09","guid":{"rendered":"https:\/\/css-tricks.com\/?p=320275"},"modified":"2020-09-10T13:58:43","modified_gmt":"2020-09-10T20:58:43","slug":"how-css-perspective-works","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/how-css-perspective-works\/","title":{"rendered":"How CSS Perspective Works"},"content":{"rendered":"\n

As someone who loves creating CSS animations, one of the more powerful tools I use is perspective<\/code>. While the perspective<\/code> property is not capable of 3D effects all by itself (since basic shapes can\u2019t have depth), you can<\/em> use the transform<\/code> property to move and rotate objects in a 3D space (with the X, Y, and Z axes), then use perspective<\/code> to control depth.<\/p>\n\n\n\n

In this article, I\u2019ll try to explain the concept of perspective<\/code>, starting with the very basics, as we work up to a fully animated 3D cube.<\/p>\n\n\n\n\n\n\n

The basics of perspective<\/h3>\n\n\n

We\u2019ll start with a simple green square and and we\u2019ll move it on all three axes.<\/p>\n\n\n\n