用「画 ASCII 图」的方式定义页面结构,可读性极高。
<div class="ga"><b>head</b><b>main</b><b>side</b></div>.ga { display: grid; grid-template-columns: 60px 1fr; grid-template-rows: 26px 1fr; grid-template-areas: 'head head' 'side main'; gap: 5px; height: 104px; width: 200px; }
.ga b { border-radius: 6px; display: grid; place-items: center; font: 600 9px/1 ui-monospace, monospace; color: #fff; }
.ga b:nth-child(1) { grid-area: head; background: #0d1117; }
.ga b:nth-child(2) { grid-area: main; background: #2b57ff; }
.ga b:nth-child(3) { grid-area: side; background: #7a4bff; }