JSFiddle - React, Tailwind, and code Playground
by spacexplorer
HTML
<p><b>Note:</b> Internet Explorer and Opera does not support the rotateY method.</p>
<div>Hello. This is a DIV element.</div>
<div class="wrapper">
<div class="div2">Hello. This is a DIV element.</div>
</div>
<div class="wrapper">
<div class="div2">Hello. This is a DIV element.</div>
</div>
<div class="wrapper">
<div class="div2">Hello. This is a DIV element.</div>
</div>
<div class="wrapper">
<div class="div2">Hello. This is a DIV element.</div>
</div>
CSS
div
{
width:100px;
height:75px;
background-color:red;
border:1px solid black;
-webkit-border-radius: 12px 0px 12px 0px;
-moz-border-radius: 12px 0px 12px 0px;
border-radius: 12px 0px 12px 0px;
}
div.wrapper {
perspective:150;
-webkit-perspective:150; /* Safari and Chrome */
background-color: #fff;
border: 1px dashed #000;
margin: 5px;
float: left;
}
div.div2 {
z-index:1;
transition: transform .5s, box-shadow .25s;
-moz-transition: -moz-transform .5s, -moz-box-shadow .25s; /* Firefox 4 */
-webkit-transition: -webkit-transform .5s, -webkit-box-shadow .25s; /* Safari and Chrome */
-o-transition: -o-transform .5s, -o-box-shadow .25s; /* Opera */
perspective:150;
-webkit-perspective:150; /* Safari and Chrome */
}
div.div2:hover
{
z-index:1000;
transform: rotate3d(-1, .5, .5, -10deg);
-webkit-transform: rotate3d(-1, .5, .5, -10deg);
-moz-transform: rotate3d(-1, .5, .5, -10deg);
transition: transform .25s, box-shadow .25s;
-moz-transition: -moz-transform .25s, -moz-box-shadow .25s; /* Firefox 4 */
-webkit-transition: -webkit-transform .25s, -webkit-box-shadow .25s; /* Safari and Chrome */
-o-transition: -o-transform .25s; /* Opera */
-moz-box-shadow: 1px 3px 4px #28333D;
-webkit-box-shadow: 1px 3px 4px #28333D;
box-shadow: 1px 3px 4px #28333D;
}