Created
March 17, 2014 12:49
-
-
Save avaly/9598639 to your computer and use it in GitHub Desktop.
Untitled
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
.parent { | |
max-width: 300px; | |
padding: 2em; | |
background: #cfc; | |
perspective: 1000px; | |
} | |
.shape { | |
position: relative; | |
height: 0; | |
padding-bottom: 62.96%; | |
transform-style: preserve-3d; | |
} | |
.flip { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
transition: .5s; | |
transform-style: preserve-3d; | |
transform-origin: right center; | |
} | |
.parent:hover .flip { | |
transform: translateX(-100%) rotateY(-180deg); | |
} | |
.card { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
backface-visibility: hidden; | |
} | |
.front { | |
background: #fcc; | |
transform: rotateY(0deg); | |
} | |
.back { | |
background: #ccf; | |
transform: rotateY(180deg); | |
} |
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="parent"> | |
<div class="shape"> | |
<div class="flip"> | |
<div class="card front"> | |
Front | |
<a href="#aaa">link</a> | |
</div> | |
<div class="card back"> | |
Back | |
<a href="#bbb">link</a> | |
</div> | |
</div> | |
</div> | |
</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
// alert('Hello world!'); |
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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment