본문 바로가기
CSS

css 3d, transform-style: preserve-3d

by 영감은어디에 2025. 3. 7.

.box{position: absolute; width: 200px; height: 200px; left: 50%; top: 20%;
    transform-style: preserve-3d;
    transform: perspective(1200px) rotateY(-50deg);
    }
.box::before{content: ''; position: absolute; left: 0; bottom: -120px; width: 100%; height: 150px; background: #000; transform: rotateX(90deg);filter: blur(40px);opacity: 0.5;}
.box div{position: absolute; inset: 0; 
    transform-style: preserve-3d;
    transform: rotateX(-10deg)
    }
.box div span {position: absolute; inset: 0; background: linear-gradient(0deg, #fdcd5d, #dd4c4c); border-radius: 20px; 
    transform: rotateX(calc(var(--i) * 45deg)); 
    transform-style:preserve-3d;
    }
<div class="box">
    <div>
        <span style="--i:1"></span>
        <span style="--i:2"></span>
        <span style="--i:3"></span>
        <span style="--i:4"></span>
    </div>
</div>

'CSS' 카테고리의 다른 글

round tab, css  (0) 2025.03.03
filter: drop-shadow  (0) 2024.10.18
mouse move  (0) 2024.10.17
나눔스퀘어 네오 폰트, 웹폰트로 사용법  (0) 2024.10.01
배경 그라디언트 애니메이션  (0) 2024.10.01
li 점 색상 바꾸기 CSS  (0) 2024.09.02
vsCode에서 css 컬러에 피커가 안보일때  (0) 2024.07.09
item:has(+ * + * + * + :hover), items .item:hover + * + * + *  (0) 2024.07.07