Introduction to CSS Grid
CSS Grid is a powerful two-dimensional layout system for creating complex layouts.
What is CSS Grid?
Grid allows you to:
- Create rows AND columns simultaneously
- Place items precisely in cells
- Build complex layouts with simple CSS
- Create responsive designs easily
Creating a Grid Container
Add display: grid to create a grid:
Loading CSS Playground...
Interactive Grid Playground
Loading Grid Playground...
Grid vs Flexbox
Loading CSS Playground...
Grid Terminology
Loading CSS Playground...
- Track: A row or column
- Cell: The space between grid lines
- Gap: Space between cells
- Line: The dividing lines (numbered from 1)
The fr Unit
fr means "fraction of available space":
Loading CSS Playground...
The middle column gets 2 parts, sides get 1 part each.
Practical: Photo Gallery
Loading CSS Playground...
Exercise: Create a Grid
Add display: grid and create 3 columns:
Loading CSS Exercise...
التالي · الدرس 21 من 27
Grid Template Columns and Rows
قراءة 2 دقيقة
أنهيت 20 من 27 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

