### 知识储备:
~~~
1. 父元素:grid-template-columns: repeat(12, 1fr); 均分12等分
2. 父元素:grid-gap: 5px; 网格间距
3. 父元素: grid-template-areas: 网格区域 (字母的排版代表布局样式)
"h h h h h h h h h h h h"
"m m c c c c c c c c c c"
"f f f f f f f f f f f f";
4. 子元素:grid-area: h; 子网格对应 网格区域的字母
~~~
demo1
~~~
<style>
* {
margin: 0;
padding: 0
}
.container {
display: grid;
grid-gap: 5px;
grid-template-columns: repeat(12, 1fr);
grid-template-rows: 50px 350px 50px;
grid-template-areas:
"h h h h h h h h h h h h"
"m m c c c c c c c c c c"
"f f f f f f f f f f f f";
}
.container div {
text-align: center;
border: 1px solid #333;
}
.header {
grid-area: h;
}
.menu {
grid-area: m;
}
.content {
grid-area: c;
}
.footer {
grid-area: f;
}
</style>
</head>
<body>
<div class="container">
<div class="header">HEADER</div>
<div class="menu">MENU</div>
<div class="content">CONTENT</div>
<div class="footer">FOOTER</div>
</div>
</body>
~~~