Created
September 21, 2017 01:48
-
-
Save arbinish/26b7ff5447d49e5c1b41293b7c24317f to your computer and use it in GitHub Desktop.
css3 flip page effect
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
== .css == | |
.postcard { | |
position: relative; | |
margin: 0 auto; | |
width: 400px; | |
height: 270px; | |
} | |
.postcard-front, | |
.postcard-back { | |
position: absolute; | |
backface-visibility: hidden; | |
transition: transform 1s ease-in-out; | |
} | |
.postcard .postcard-back { | |
transform: rotateY(180deg); | |
} | |
.postcard:hover .postcard-front { | |
transform: rotateY(180deg); | |
} | |
.postcard:hover .postcard-back { | |
transform: rotateY(0deg); | |
} | |
== .html == | |
<div class="postcard"> | |
<div class="postcard-back"><img height="270" width="400" src="backImage.png" alt=""></div> | |
<div class="postcard-front"><img height="270" width="400" src="frontImage.png" alt=""></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment