HTML/CSSAdvanced#css#grid#layout-puzzle

What is the 'holy grail' layout and how is it built with Grid?

It's a classic layout with a header, footer, fixed-width sidebars, and a flexible center content area, historically hard to build with floats. CSS Grid makes it trivial using grid-template-areas or template-columns.

Example
body {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header header"
    "nav main aside"
    "footer footer footer";
  min-height: 100vh;
}

Related Questions

1
HTML/CSSAdvanced#css#units

What is the difference between relative units vw/vh and %?

Open
2
HTML/CSSBeginner#css#box-model

What is the box-sizing property and why is border-box generally preferred?

Open
3
HTML/CSSBeginner#css#pseudo-classes

What is the difference between :hover, :focus, and :active pseudo-classes?

Open