TAG
CSS
Result
Run
License
<div class="perspective-ok"> <div>Perspective OK</div> </div> <br /> <div class="perspective-none"> <div>Perspective None</div> </div>
div[class^='perspective'] { position: relative; left: calc(50% - (200px / 2)); width: 200px; height: 200px; border: 1px solid #CCC; } div[class^='perspective'] > div { position: absolute; width: 100%; height: 100px; background-color: #FF0000; font-size: 20px; font-weight: bold; padding-top: 50px; color: #FFF; text-align: center; transform-style: preserve-3d; transform: rotateX(20deg); } .perspective-ok { perspective: 100px; } .perspective-none { perspective: none; }
Console
expand_less
License
License
by DevDic
Close