CSS Grid布局-命名区域
html公开前 25 行,完整代码需登录
<style>
.grid {
display: grid;
grid-template-areas:
"header header header"
"sidebar main main"
"footer footer footer";
grid-template-columns: 200px 1fr 1fr;
grid-template-rows: 80px 1fr 60px;
gap: 10px;
background-color: #e8e8e8;
padding: 10px;
min-height: 400px;
}
.grid-item {
border: 1px solid #000;
color: white;
font-size: 20px;
font-weight: bold;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.header {