>  기사  >  웹 프론트엔드  >  CSS를 사용하여 화면을 향하지 않을 때 요소가 표시되는지 여부 결정

CSS를 사용하여 화면을 향하지 않을 때 요소가 표시되는지 여부 결정

PHPz
PHPz앞으로
2023-08-30 12:49:101126검색

用 CSS 确定元素在不面向屏幕时是否可见

화면을 향하지 않을 때 요소가 표시되는지 확인하려면 backface-visibility 속성을 사용하세요.

Live Demo

<!DOCTYPE html>
<html>
<head>
   <style>
      .demo1 {
         position: relative;
         width: 150px;
         height: 150px;
         background-color: yellow;
         perspective: 80px;
         margin: 50px;
         perspective-origin: left;
         transform: rotateY(180deg);
      }
      .demo2 {
         position: absolute;
         padding: 20px;
         background-color: orange;
         transform-style: preserve-3d;
         transform: rotateX(45deg);
         backface-visibility: visible;
      }
      </style>
   </head>
   <body>
      <h1>Rotation</h1>
      <div class = "demo1">Demo
         <div class = "demo2">Demo</div>
      </div>
   </body>
</html>

위 내용은 CSS를 사용하여 화면을 향하지 않을 때 요소가 표시되는지 여부 결정의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제