CSS perspective-origin property

CSSWeb DevelopmentFront End Technology

Use the perspective-origin property to specify the bottom position of 3D elements.

You can try to run the following code to implement the perspective-origin property:

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
        .demo1 {
            position: relative;
            width: 150px;
            height: 150px;
            background-color: yellow;
            perspective: 80px;
            margin: 50px;
            perspective-origin: left;
         }
         .demo2 {
            position: absolute;
            padding: 20px;
            background-color: orange;
            transform-style: preserve-3d;
            transform: rotateX(45deg);
         }
      </style>
   </head>

   <body>
      <h1>Rotation</h1>
      <div class = "demo1">Demo
         <div class = "demo2">Demo</div>
      </div>
   </body>
</html>
raja
Published on 16-May-2018 11:18:31
Advertisements