CSS শেপ ব্যবহার করে ডিভ দিয়ে ওয়েব ডিজাইন: একটি সম্পূর্ণ গাইড
ওয়েব ডিজাইনে CSS শেপ (CSS Shapes) একটি শক্তিশালী টুল যা ডিজাইনারদেরকে ট্রাডিশনাল রেকটাঙ্গুলার বক্সের বাইরে গিয়ে ক্রিয়েটিভ লেআউট তৈরি করতে সাহায্য করে? CSS শেপ ব্যবহার করে আপনি সহজেই সার্কেল, ট্রায়াঙ্গেল, পলিগন এবং এমনকি কাস্টম শেপ তৈরি করতে পারবেন যা আপনার ওয়েবসাইটকে ইউনিক লুক দেবে।
CSS শেপ কি?
CSS শেপ হলো CSS এর একটি মডিউল যা এলিমেন্টগুলিকে নন-রেকটাঙ্গুলার শেপে ডিসপ্লে করতে দেয়।
/* Circle shape using border-radius */
.shape {
width: 200px;
height: 200px;
background-color: #3498db;
border-radius: 50%;
}
CSS শেপের প্রকারভেদ
১. বেসিক শেপ
বৃত্ত (Circle)
/* Basic circle */
.circle {
width: 150px;
height: 150px;
background-color: #e74c3c;
border-radius: 50%;
}
ওভাল (Oval)
/* Oval shape */
.oval {
width: 200px;
height: 100px;
background-color: #2ecc71;
border-radius: 100px / 50px;
}
ত্রিভুজ (Triangle)
/* Triangle shape using borders */
.triangle {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid #f39c12;
}
২. কাস্টম শেপ
clip-path প্রপার্টি ব্যবহার করে কাস্টম শেপ:
/* Triangle-style custom shape using clip-path */
.custom-shape {
width: 200px;
height: 200px;
background-color: #9b59b6;
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
CSS শেপের প্র্যাকটিক্যাল ব্যবহার
১. ইমেজের চারপাশে টেক্সট র্যাপ
/* Wrapping text around a circle */
.shape-wrap {
shape-outside: circle(50%);
width: 300px;
height: 300px;
float: left;
border-radius: 50%;
}
২. ক্রিয়েটিভ বাটন ডিজাইন
/* Creative button shape using clip-path */
.creative-btn {
clip-path: polygon(0 20%, 60% 20%, 65% 0, 100% 50%, 65% 100%, 60% 80%, 0 80%);
background: linear-gradient(45deg, #3498db, #9b59b6);
color: white;
padding: 15px 40px;
border: none;
font-weight: bold;
}
৩. ইউনিক হেডার ডিজাইন
/* Elliptical header design */
.header {
height: 300px;
background: #3498db;
clip-path: ellipse(100% 60% at 50% 40%);
}
CSS শেপের অ্যাডভান্সড টেকনিক: এনিমেশন
/* Rotating shape using animation */
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.animated-shape {
width: 100px;
height: 100px;
background-color: #e74c3c;
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
animation: rotate 5s linear infinite;
}
SVG শেপের সাথে CSS
<div class="svg-container">
<svg viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="#3498db" />
</svg>
</div>
CSS শেপের রেস্পন্সিভ ডিজাইন
/* Responsive circle shape */
.responsive-shape {
width: 20vw;
height: 20vw;
clip-path: circle(50% at center);
}
@media (max-width: 768px) {
.responsive-shape {
width: 40vw;
height: 40vw;
}
}
CSS শেপের বেস্ট প্র্যাকটিস
- Use progressive enhancement
- Use SVG for complex shapes
- Always test on multiple devices
- Maintain readability and accessibility
প্র্যাকটিস উদাহরণ
বৃত্তাকার প্রোফাইল কার্ড
<div class="profile-card">
<div class="profile-img"></div>
<h3>আপনার নাম</h3>
<p>ওয়েব ডিজাইনার</p>
</div>
ট্রায়াঙ্গুলার হাইলাইট সেকশন
.highlight-section::after {
content: "";
position: absolute;
bottom: -50px;
left: 0;
right: 0;
height: 50px;
background: #3498db;
clip-path: polygon(0 0, 50% 100%, 100% 0);
}
ইউনিক বুলেট পয়েন্ট
.custom-bullets li::before {
content: "";
width: 20px;
height: 20px;
background-color: #e74c3c;
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
উদাহরণগুলো?
CSS শেপ ব্যবহার করে আপনি আপনার ওয়েবসাইটকে আরও ইউনিক ও আকর্ষণীয় করে তুলতে পারেন। প্র্যাকটিস করুন, এবং আপনার ডিজাইনে শেপের ম্যাজিক যোগ করুন?
Tags:
Web Build & Code