Introduction

The Perspective Origin property is a property of CSS3. Which is used to define where a 3D element is based on the axis (x and y-axis). This property is only supported by Google Chrome and Safari ( With the help of (webkit-perspective-origin property). When we define the property on any element its child elements are effected, the element has not affected by this, in my case, I define this property in div1 but it can affect both div2 and div3. This property only affects the 3D transformed elements.
Ex:
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. #div1
  5. {
  6. position: relative;
  7. height: 150px;
  8. width: 150px;
  9. padding: 15px;
  10. margin: 45px;
  11. border: 2px solid Red;
  12. perspective: 150;
  13. perspective-origin: 10% 10%;
  14. -webkit-perspective: 150;
  15. /* For Google Chrome and Safari */
  16. -webkit-perspective-origin: 10% 10%;
  17. /* For Google Chrome and Safari */
  18. }
  19. #div2
  20. {
  21. padding: 50px;
  22. position: absolute;
  23. border: 2px solid black;
  24. background-color: Brown;
  25. transform: rotateY(40deg);
  26. -webkit-transform: rotateY(40deg);
  27. /* For Google Chrome and Safari */
  28. }
  29. #div3
  30. {
  31. padding: 150px;
  32. position: absolute;
  33. border: 1px solid black;
  34. background-color: Blue;
  35. transform: rotateY(40deg);
  36. -webkit-transform: rotateY(40deg);
  37. /* For Google Chrome and Safari */
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div id="div1">
  43. <div id="div2">Mahak</div>
  44. <div id="div3">Mahak</div>
  45. </div>
  46. </body>
  47. </html>
The output will be:
1.png