Skip to content

Instantly share code, notes, and snippets.

@arbinish
Created September 21, 2017 01:48
Show Gist options
  • Save arbinish/26b7ff5447d49e5c1b41293b7c24317f to your computer and use it in GitHub Desktop.
Save arbinish/26b7ff5447d49e5c1b41293b7c24317f to your computer and use it in GitHub Desktop.
css3 flip page effect
== .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