<div class="flip-container">
<div class="flipper">
<div class="front">
<div class="chip"></div>
<div class="card-num">4242 4242 4242 4242</div>
<div class="card-name">JOHN DOE</div>
<div class="card-exp">12/28</div>
<div class="card-logo">VISA</div>
</div>
<div class="back">
<div class="magnetic-strip"></div>
<div class="cvv-box">
<span>CVV</span>
<div class="cvv-num">123</div>
</div>
<div class="card-logo back-logo">VISA</div>
</div>
</div>
</div>
<p style="text-align:center; margin-top:20px;">Hover card to flip</p>* {
box-sizing: border-box;
}
.flip-container {
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
perspective: 1000px;
width: 320px;
height: 200px;
margin: 0 auto;
}
.flipper {
position: relative;
width: 100%;
height: 100%;
transition: transform 0.6s;
transform-style: preserve-3d;
}
.flip-container:hover .flipper {
transform: rotateY(180deg);
}
.front, .back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 16px;
box-shadow: 0 15px 35px rgba(0,0,0,0.2);
color: white;
padding: 20px;
box-sizing: border-box;
}
.front {
background: linear-gradient(135deg, #1e293b, #0f172a);
}
.back {
background: linear-gradient(135deg, #1e293b, #0f172a);
transform: rotateY(180deg);
}
/* Front Details */
.chip {
width: 40px;
height: 30px;
background: #fbbf24;
border-radius: 5px;
margin-bottom: 40px;
}
.card-num {
font-size: 1.4rem;
letter-spacing: 2px;
font-family: monospace;
margin-bottom: 25px;
}
.card-name {
text-transform: uppercase;
font-size: 0.8rem;
}
.card-exp {
position: absolute;
bottom: 20px;
right: 80px;
font-size: 0.9rem;
}
.card-logo {
position: absolute;
bottom: 20px;
right: 20px;
font-weight: 800;
font-style: italic;
font-size: 1.2rem;
}
/* Back Details */
.magnetic-strip {
background: #000;
height: 40px;
width: 100%;
position: absolute;
left: 0;
top: 20px;
}
.cvv-box {
background: #fff;
color: #000;
width: 100%;
margin-top: 60px;
padding: 10px;
border-radius: 4px;
text-align: right;
font-family: monospace;
position: relative;
}
.cvv-box span {
position: absolute;
top: -20px;
right: 0;
color: white;
font-size: 0.7rem;
}Nothing to show yetType HTML, CSS or JavaScript and your page appears here.
Click any element to find its code Esc
Check this code before you run it
It came from a shared link. It runs with fewer permissions, so it cannot open pop-ups, submit forms or start downloads.
0.00s / 0.00s
Nothing has animated yet. Hover, click or type in the preview and each CSS animation, transition or
element.animate() call shows up here as it plays.