Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS 퍼스펙티브 속성의 사용

<시간/>

3D 요소가 표시되는 방식에 대한 관점을 지정하려면 CSS 관점 속성을 사용하세요.

다음 코드를 실행하여 관점 속성을 사용할 수 있습니다.

예시

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo1 {
            position: relative;
            width: 150px;
            height: 150px;
            background-color: yellow;
            perspective: 80px;
            margin: 50px;
         }
         .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>