Skip to content

Instantly share code, notes, and snippets.

@Davisonpro
Created September 21, 2019 11:32
Show Gist options
  • Save Davisonpro/e7d15203dd43d46677c73b0e10766d56 to your computer and use it in GitHub Desktop.
Save Davisonpro/e7d15203dd43d46677c73b0e10766d56 to your computer and use it in GitHub Desktop.
.container {
display: flex;
align-items: center;
background: #ffffff;
height: 100vh;
width: 100%;
}
.card {
position: relative;
width: 300px;
height: 300px;
margin: 0 auto;
background: #8056ff;
font-size: 20px;
transition: 0.6s;
transform-style: preserve-3d;
}
/* flip the card when hovered */
.card:hover {
transform: rotateY(180deg);
}
.front,
.back {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
color: #ffffff;
text-align: center;
padding: 20px;
backface-visibility: hidden;
transition: 0.6s;
transform-style: preserve-3d;
}
.front {
background: #8056ff;
transform: rotateY(0deg);
z-index: 2;
}
.back {
background: #d4662b;
transform: rotateY(-180deg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment