Skip to content

Instantly share code, notes, and snippets.

@Demwunz
Created October 14, 2013 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Demwunz/6977147 to your computer and use it in GitHub Desktop.
Save Demwunz/6977147 to your computer and use it in GitHub Desktop.
3d card flip css
<div class="flip" style="width: X.px; height: X.px;">
<a href="#">
<div class="flip-front">
...
</div>
<div class="flip-back">
...
</div>
</a>
</div>
@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