Урок 9.3. Grid CSS: grid-template-areas

Опубликовано: 09 Май 2026
на канале: Web-garage
213
9

Playlist clone on Yandex.Zen: https://dzen.ru/suite/fb7317b3-283e-4...

🎥 Key Properties: `grid-template-areas`

Welcome to this exciting journey through the world of CSS Grid! Today we'll explore one of the most powerful and flexible properties – `grid-template-areas`.

📐 What is `grid-template-areas`?

`grid-template-areas` is a CSS Grid property that allows you to define your grid layout using descriptive area names. This makes layouts more readable and manageable.

🔧 Key Features:

📦 Defining Areas: Create areas with descriptive names like "header", "sidebar", "content", etc.
📏 Flexibility: Easily rearrange elements by simply moving area names within the template.
🎨 Visual Clarity: Layouts become clearer, making them easier to develop and maintain.

📝 Example usage:

```css
.container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: auto;
grid-template-areas:
"header header header"
"sidebar content content"
"footer footer footer";
}

.header { grid-area: header; }
.sidebar { grid-area: sidebar; }
.content { grid-area: content; }
.footer { grid-area: footer; }
```

🚀 Benefits:

🌟 Ease of use: Easy-to-remember syntax.
🌈 Design flexibility: Create complex layouts with minimal code.
🔍 Improved readability: Code becomes more understandable and manageable.

🔗 Useful links:

[MDN Web Docs: grid-template-areas] (https://developer.mozilla.org/en-US/d...)
[CSS-Tricks: A Complete Guide to Grid] (https://css-tricks.com/snippets/css/c...)

👍 Subscribe to our channel to stay up-to-date with new lessons and tips on front-end development!

#html5course #css3course #cssgrid