示例工程 18-grid-patterns
18-grid-patterns/demo-01-gallery/style.css
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
body {
margin: 0;
padding: 32px;
background: #f8fafc;
color: #0f172a;
font-family: system-ui, sans-serif;
line-height: 1.7;
}
h1 {
margin: 0 0 8px;
font-size: 26px;
}
h2 {
margin: 18px 0 6px;
font-size: 13px;
color: #64748b;
}
.wall {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
grid-auto-rows: 76px;
gap: 8px;
max-width: 520px;
padding: 8px;
border: 1px dashed #cbd5e1;
border-radius: 8px;
background: #ffffff;
}
.feature {
grid-auto-flow: row dense;
}
.shot {
display: grid;
place-items: center;
border-radius: 6px;
background: #2563eb;
color: #ffffff;
font-size: 12px;
font-family: ui-monospace, monospace;
}
.big {
grid-column: span 2;
grid-row: span 2;
background: linear-gradient(135deg, #2563eb, #7c3aed);
font-size: 11px;
letter-spacing: 0.1em;
}