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

The perspective-origin<\/code> property determines the origin for the perspective<\/a><\/code> property. Think of it as the vanishing point of the current 3D-space.<\/p>\n\n\n\n

Note as for the perspective<\/code> property, perspective-origin<\/code> has to be defined on the parent element in order to give the transformed children depth.<\/p>\n\n\n\n

The perspective-origin<\/code> property doesn’t do anything by itself. It has to be defined on an element along with perspective<\/code>.<\/p>\n\n\n\n\n\n\n\n

\/**\n * Syntax \n * perspective-origin: x-position\n * perspective-origin: x-position y-position\n * \n * perspective-origin: <percentage> | <length> | constants | inherit\n *\/\n\n.element1 { perspective-origin: 25% 75%; }\n\n.element2 { perspective-origin: 10px 25px; }\n\n.element3 { perspective-origin: left bottom; }<\/code><\/pre>\n\n\n\n

Below is a demo showing how a 3D cube behaves when altering its vanishing point by changing the perspective-origin<\/code> value (constants).<\/p>\n\n\n\n