CSS Grid Layout kya hai?

CSS Grid layout 2D grid system provide karta hai jisme aap rows aur columns dono me elements ko organize kar sakte hain. Ye modern aur flexible web layouts ke liye bahut powerful tool hai.

Grid Container aur Grid Items

CSS Grid me ek parent element jisme display: grid; laga hota hai, use Grid Container kehte hain. Us container ke direct children Grid Items hote hain.

Basic Example

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 20px;
}
.grid-item {
  background-color: #db1d29;
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
}

Important Grid Properties

Summary

CSS Grid layout se complex aur responsive 2D layouts design karna bahut easy ho jata hai. Ye modern web development ka ek essential tool hai jo Flexbox ke saath milke best results deta hai.