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

CSS দিয়ে ইমেজ ওভারলে হোভার স্লাইড ইফেক্ট তৈরি


উদাহরণ

নিচের কোডটি CSS ব্যবহার করে ইমেজ ওভারলে হোভার স্লাইড ইফেক্ট তৈরি করার উদাহরণ:

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .card-container { position: relative; width: 50%; } img { display: block; width: 100%; } .overlay { position: absolute; bottom: 100%; background-color: rgb(55, 74, 179); overflow: hidden; width: 100%; height: 0; transition: .5s ease-in-out; } .card-container:hover .overlay { bottom: 0; height: 100%; } .caption { color: white; font-size: 30px; position: absolute; top: 50%; left: 50%; text-align: center; } </style> </head> <body> <h1>Image Overlay Slide Example</h1> <div class="card-container"> <img src="https://i.picsum.photos/id/237/536/354.jpg"> <div class="overlay"> <div class="caption">Dog</div> </div> </div> </body> </html>

আউটপুট

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

CSS দিয়ে ইমেজ ওভারলে হোভার স্লাইড ইফেক্ট তৈরি

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

CSS দিয়ে ইমেজ ওভারলে হোভার স্লাইড ইফেক্ট তৈরি

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

  2. CSS দিয়ে ওভারলে ইফেক্ট তৈরি করার পদ্ধতি

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

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