示例工程 18-grid-patterns
18-grid-patterns/demo-02-calendar/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;
}
.cal {
display: grid;
grid-template-columns: repeat(7, minmax(0, 1fr));
gap: 4px;
max-width: 520px;
margin-top: 14px;
padding: 8px;
border: 1px solid #e2e8f0;
border-radius: 10px;
background: #ffffff;
}
.dow {
padding: 4px 0;
color: #64748b;
font-size: 11px;
text-align: center;
}
.day {
display: grid;
place-items: center;
min-height: 40px;
border-radius: 6px;
background: #f1f5f9;
font-size: 12px;
}
.out {
background: transparent;
color: #94a3b8;
}