Created
October 14, 2013 15:06
-
-
Save Demwunz/6977147 to your computer and use it in GitHub Desktop.
3d card flip css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="flip" style="width: X.px; height: X.px;"> | |
<a href="#"> | |
<div class="flip-front"> | |
... | |
</div> | |
<div class="flip-back"> | |
... | |
</div> | |
</a> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "compass/css3"; | |
/* 3D Flips */ | |
.flip { | |
position: relative; | |
@include perspective(1000); | |
.flip-front, .flip-back { | |
position: absolute; | |
top: 0; | |
left: 0; | |
@include transform-style(preserve-3d); | |
@include backface-visibility(hidden); | |
@include transition(0.75s); | |
} | |
.flip-front { | |
z-index: 5; | |
} | |
.flip-back { | |
z-index: 0; | |
@include rotateY(-180deg); | |
} | |
&:hover .flip-front { | |
z-index: 5; | |
@include rotateY(180deg); | |
} | |
&:hover .flip-back { | |
z-index: 10; | |
@include rotateY(0deg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment