grid-template-areas: "header header header" "nav main main" "nav footer footer";
The 'header' area appears three times in the first row, so it covers 3 grid cells horizontally.
grid-template-areas property?Option A is invalid because the first row has 2 area names ("header header") while the second has 3 ("nav main footer"). All rows in grid-template-areas must have the same number of space-separated area names to define a rectangular grid.
grid-template-columns: 1fr 2fr 1fr; grid-template-rows: 50px 100px; grid-template-areas: "a a b" "c d d";
Which area will be the widest?
Area 'a' spans the first two columns: 1fr + 2fr = 3fr total width, which is wider than any other area.
<div class="container"> <div class="header">Header</div> <div class="sidebar">Sidebar</div> <div class="content">Content</div> </div> .container { display: grid; grid-template-areas: "header header" "sidebar content"; } .sidebar { /* Which selector targets this grid area? */ }
The element with class 'sidebar' should have grid-area: sidebar; to match the grid-template-areas name.
grid-template-areas for layout, which practice best supports screen reader users?Using semantic HTML and ARIA roles helps screen readers understand the layout and purpose of each area, improving accessibility.
