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

CSS দিয়ে আইকন বাটন তৈরি করার পদ্ধতি


উদাহরণ

নিচের কোডটি CSS এবং Font Awesome ব্যবহার করে আইকনযুক্ত বাটন তৈরি করার পদ্ধতি দেখায়:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<style>
button {
    font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
    background-color: rgb(30, 173, 255);
    border: none;
    color: white;
    padding: 12px 16px;
    font-size: 32px;
    cursor: pointer;
}
i {
    padding: 15px;
    color: rgb(33, 0, 109);
}
button:hover {
    background-color: rgb(81, 44, 148);
}
button:hover i {
    color: white;
}
</style>
</head>
<body>
<h1 style="font-size: 60px; font-family: Arial, Helvetica, sans-serif;"> Icon Buttons Example </h1>
<button><i class="fa fa-home"></i>Home</button>
<button> <i class="fa fa-phone-square" aria-hidden="true"></i>Call Us </button>
<button><i class="fa fa-map-marker" aria-hidden="true"></i>Visit Us</button>
<button><i class="fa fa-cog" aria-hidden="true"></i>Settings</button>
<button><i class="fa fa-user-o" aria-hidden="true"></i>Login</button>
</body>
</html>

আউটপুট

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

CSS দিয়ে আইকন বাটন তৈরি করার পদ্ধতি

আইকন বাটনগুলির উপরে হোভার করলে:

CSS দিয়ে আইকন বাটন তৈরি করার পদ্ধতি


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

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

  3. CSS দিয়ে চ্যাট মেসেজ (Chat Message) তৈরি

  4. CSS দিয়ে সেকশন কাউন্টার (Section Counter) তৈরি করা