কম্পিউটার টিউটোরিয়াল

CSS দিয়ে ফ্লিপ কার্ড তৈরি করার পদ্ধতি


উদাহরণ

নিচের কোডটি CSS 3D ট্রান্সফর্ম ব্যবহার করে হোভারে ফ্লিপ হওয়া কার্ড তৈরি করার পদ্ধতি দেখায়:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 20px;
}
.flipCard {
    background-color: transparent;
    width: 300px;
    height: 300px;
    perspective: 1000px;
}
.innerCard {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}
.flipCard:hover .innerCard {
    transform: rotateY(180deg);
}
.frontCard, .cardBack {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.frontCard {
    background-color: rgb(124, 225, 243);
    color: black;
}
.cardBack {
    background-color: #3329b9;
    color: white;
    transform: rotateY(180deg);
    font-size: 18px;
    font-weight: bold;
}
</style>
</head>
<body>
<h1>Card Flip with Text Example</h1>
<div class="flipCard">
<div class="innerCard">
<div class="frontCard">
<img src="https://cdn.pixabay.com/photo/2016/04/01/11/25/avatar-1300331_960_720.png" alt="Avatar" style="width:300px;height:300px;">
</div>
<div class="cardBack">
<h1>James Anderson</h1>
<p>Architect</p>
<p>Experience: 16 years</p>
</div>
</div>
</div>
<h2>Hover over the above image to see the text</h2>
</body>
</html>

আউটপুট

উপরোক্ত কোড নিচের আউটপুটটি তৈরি করবে:

CSS দিয়ে ফ্লিপ কার্ড তৈরি করার পদ্ধতি

ইমেজের উপরে হোভার করলে:

CSS দিয়ে ফ্লিপ কার্ড তৈরি করার পদ্ধতি


  1. CSS দিয়ে কুপন তৈরি করার পদ্ধতি

  2. CSS দিয়ে ফ্লিপ বক্স (Flip Box) তৈরি

  3. CSS দিয়ে অ্যারো (Arrow) তৈরি

  4. CSS দিয়ে রিসপন্সিভ কলাম কার্ড (Responsive Column Cards) তৈরি করা