{"id":123,"date":"2026-04-07T04:24:17","date_gmt":"2026-04-07T04:24:17","guid":{"rendered":"https:\/\/gigz.pk\/css\/?post_type=lesson&#038;p=123"},"modified":"2026-04-07T04:24:18","modified_gmt":"2026-04-07T04:24:18","slug":"grid-areas","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/","title":{"rendered":"Grid Areas"},"content":{"rendered":"\n<p>CSS Grid Areas is a powerful feature of CSS Grid that allows you to design web layouts using named sections. Instead of placing items using numbers or lines, you can assign names to different parts of your layout and arrange them easily.<\/p>\n\n\n\n<p>What are Grid Areas<\/p>\n\n\n\n<p>Grid Areas are named sections of a grid container. You define these areas using the grid template areas property and then assign elements to those areas using the grid area property.<\/p>\n\n\n\n<p>This makes your layout more readable and easier to manage, especially for complex designs.<\/p>\n\n\n\n<p>Why use Grid Areas<\/p>\n\n\n\n<p>Grid Areas help you create structured layouts quickly<br>They improve code readability<br>They make responsive design easier<br>They allow you to rearrange layouts without changing HTML<\/p>\n\n\n\n<p>Basic Example<\/p>\n\n\n\n<p>First, create a grid container and define areas<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.container {<br>  display: grid;<br>  grid-template-areas:<br>    \"header header\"<br>    \"sidebar content\"<br>    \"footer footer\";<br>}<\/pre>\n\n\n\n<p>Then assign elements to each area<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.header {<br>  grid-area: header;<br>}.sidebar {<br>  grid-area: sidebar;<br>}.content {<br>  grid-area: content;<br>}.footer {<br>  grid-area: footer;<br>}<\/pre>\n\n\n\n<p>In this example, the layout has a header at the top, a sidebar and content in the middle, and a footer at the bottom.<\/p>\n\n\n\n<p>Understanding the Layout<\/p>\n\n\n\n<p>Each word inside the grid template areas represents a column<br>Each line represents a row<br>Repeating a name means the area spans multiple columns<\/p>\n\n\n\n<p>For example, header header means the header takes two columns<\/p>\n\n\n\n<p>Responsive Design with Grid Areas<\/p>\n\n\n\n<p>You can easily change layouts for different screen sizes using media queries<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">@media (max-width: 600px) {<br>  .container {<br>    grid-template-areas:<br>      \"header\"<br>      \"content\"<br>      \"sidebar\"<br>      \"footer\";<br>  }<br>}<\/pre>\n\n\n\n<p>This will stack all sections vertically on small screens.<\/p>\n\n\n\n<p>Best Practices<\/p>\n\n\n\n<p>Use meaningful names like header, main, sidebar, footer<br>Keep layouts simple and easy to understand<br>Test layouts on different screen sizes<br>Combine grid areas with other grid properties for better control<\/p>\n\n\n\n<p>Conclusion<\/p>\n\n\n\n<p>CSS Grid Areas make layout design simple and flexible. They allow you to visually organize your webpage structure using names instead of complex positioning. This is especially useful for beginners who want to build clean and responsive website layouts.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"menu_order":0,"template":"","class_list":["post-123","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Grid Areas - CSS learning mastery<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Grid Areas - CSS learning mastery\" \/>\n<meta property=\"og:description\" content=\"CSS Grid Areas is a powerful feature of CSS Grid that allows you to design web layouts using named sections. Instead of placing items using numbers or lines, you can assign names to different parts of your layout and arrange them easily. What are Grid Areas Grid Areas are named sections of a grid container. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/\" \/>\n<meta property=\"og:site_name\" content=\"CSS learning mastery\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-07T04:24:18+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/grid-areas\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/grid-areas\\\/\",\"name\":\"Grid Areas - CSS learning mastery\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/#website\"},\"datePublished\":\"2026-04-07T04:24:17+00:00\",\"dateModified\":\"2026-04-07T04:24:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/grid-areas\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/grid-areas\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/lesson\\\/grid-areas\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Grid Areas\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/css\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/css\\\/\",\"name\":\"CSS learning mastery\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/css\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Grid Areas - CSS learning mastery","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/","og_locale":"en_US","og_type":"article","og_title":"Grid Areas - CSS learning mastery","og_description":"CSS Grid Areas is a powerful feature of CSS Grid that allows you to design web layouts using named sections. Instead of placing items using numbers or lines, you can assign names to different parts of your layout and arrange them easily. What are Grid Areas Grid Areas are named sections of a grid container. [&hellip;]","og_url":"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/","og_site_name":"CSS learning mastery","article_modified_time":"2026-04-07T04:24:18+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/","url":"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/","name":"Grid Areas - CSS learning mastery","isPartOf":{"@id":"https:\/\/gigz.pk\/css\/#website"},"datePublished":"2026-04-07T04:24:17+00:00","dateModified":"2026-04-07T04:24:18+00:00","breadcrumb":{"@id":"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/css\/lesson\/grid-areas\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/css\/lesson\/grid-areas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/css\/"},{"@type":"ListItem","position":2,"name":"Grid Areas"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/css\/#website","url":"https:\/\/gigz.pk\/css\/","name":"CSS learning mastery","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/css\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/lesson\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/css\/wp-json\/wp\/v2\/media?parent=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}