🌐 Detecting your location…

सीएसएस ग्रिड संपूर्ण गाइड 2026: लेआउट, पैटर्न और रिस्पॉन्सिव डिज़ाइन

⏱️1 min read  ·  210 words
CSS Grid Complete Guide 2026: Layouts, Patterns and Responsive Design

सीएसएस ग्रिडCSS में सबसे शक्तिशाली लेआउट सिस्टम है। 2026 में, ब्राउज़र समर्थन 99%+ है और सीएसएस ग्रिड का उपयोग पेज-स्तरीय लेआउट से लेकर जटिल कार्ड ग्रिड और डैशबोर्ड तक हर चीज के लिए किया जाता है। यह मार्गदर्शिका ग्रिड को बुनियादी बातों से लेकर उन्नत पैटर्न तक कवर करती है।

ग्रिड मूल बातें

/* Enable grid */
.container {
  display: grid;

  /* 3 equal columns */
  grid-template-columns: 1fr 1fr 1fr;

  /* Or shorthand */
  grid-template-columns: repeat(3, 1fr);

  /* Rows */
  grid-template-rows: auto 1fr auto;

  /* Gap between cells */
  gap: 1rem;
}

<div class="container">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
  <div>Item 4</div>
  <div>Item 5</div>
  <div>Item 6</div>
</div>

ग्रिड टेम्पलेट क्षेत्र (सिमेंटिक लेआउट)

.page {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  grid-template-columns: 250px 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  gap: 1rem;
}

.header  { grid-area: header; }
.sidebar { grid-area: sidebar; }
.main    { grid-area: main; }
.footer  { grid-area: footer; }

स्तंभों और पंक्तियों को फैलाना

.featured {
  grid-column: 1 / 3;    /* span 2 columns */
  /* or: */
  grid-column: span 2;
}

.hero {
  grid-row: 1 / 3;       /* span 2 rows */
}

.full-width {
  grid-column: 1 / -1;   /* span all columns */
}

स्वतः-भरण और स्वतः-फ़िट (उत्तरदायी ग्रिड)

/* Cards that auto-wrap: minimum 280px, fill available space */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* auto-fill: keeps empty column tracks
   auto-fit: collapses empty tracks */
.card-grid-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

नामित ग्रिड लाइन्स

.layout {
  display: grid;
  grid-template-columns:
    [full-start] 1rem
    [content-start] 1fr
    [content-end] 1rem
    [full-end];
}

.bleed-full {
  grid-column: full-start / full-end;
}

.content {
  grid-column: content-start / content-end;
}

ग्रिड बनाम फ्लेक्सबॉक्स: कब किसका उपयोग करें

  • सीएसएस ग्रिड:द्वि-आयामी लेआउट (पंक्तियाँ और कॉलम), पृष्ठ संरचना, डैशबोर्ड, जटिल कार्ड लेआउट
  • फ्लेक्सबॉक्स:एक-आयामी (पंक्ति या स्तंभ), नेविगेशन बार, बटन समूह, केंद्रित सामग्री
  • दोनों एक साथ:पेज लेआउट के लिए ग्रिड, ग्रिड सेल के अंदर आइटम के लिए फ्लेक्सबॉक्स

मीडिया प्रश्नों के बिना उत्तरदायी ग्रिड

/* Works at any viewport width — no breakpoints needed */
.responsive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
}

निष्कर्ष

सीएसएस ग्रिड सीएसएस में सबसे शक्तिशाली परिवर्धनों में से एक है।grid-template-areasका प्रयोग करें सिमेंटिक पेज लेआउट के लिए,repeat(auto-fill, minmax(...))प्रतिक्रियाशील कार्ड ग्रिड के लिए, और जटिल संपादकीय लेआउट के लिए नामित पंक्तियाँ। फ्लेक्सबॉक्स के साथ मिलकर, आप सीएसएस ढांचे के बिना कोई भी लेआउट बना सकते हैं।

MD Rafikul Islam

Written by

MD Rafikul Islam is a software developer and the editor of TechPulse. He writes about developer tooling, hardware, and the practical decisions that come up in day-to-day engineering work — which laptop to buy, which framework to commit to, why a build broke at 2am. He tests the tools he writes about and says plainly when something is not worth the money. Corrections and corrections requests are welcome at rony.yf25@gmail.com.

✍️ Leave a Comment

Your email address will not be published. Required fields are marked *

🌐 Read in:🇬🇧 English🇩🇪 Deutsch🇧🇷 Português🇸🇦 العربية🇮🇳 हिन्दी🇧🇩 বাংলা