<h1>Hover on Card given below</h1>
<div class="flip-box">
<div class="flip-box-inner">
<div class="flip-box-front">
<h2>Front Side</h2>
</div>
<div class="flip-box-back">
<h2>Back Side</h2>
</div>
</div>
</div>
*{
font-family:sans-serif;
}
/* flip card starts here */
.flip-box {
background-color: transparent;
width: 300px;
margin:auto;
height: 200px;
perspective: 1000px; /* Remove this if you don't want the 3D effect */
}
/* This is to position the front and back side */
.flip-box-inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.8s;
transform-style: preserve-3d;
}
/* Do an horizontal flip when you move hover on container */
.flip-box:hover .flip-box-inner {
transform: rotateY(180deg);
}
/* Put the front and back side */
.flip-box-front, .flip-box-back {
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden; /* Safari */
backface-visibility: hidden;
}
/* Style the front side */
.flip-box-front {
background: linear-gradient(246deg, #5d9acb, #67dac5);
color: black;
}
/* Style the back side */
.flip-box-back {
background: linear-gradient(297deg, #fb1ea1, #ca51dc);
color: white;
transform: rotateY(180deg);
}
// Ofcourse no Js
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.