示例工程 22-mobile-first
22-mobile-first/demo-01-landing/style.css
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
body {
margin: 0;
background: #f8fafc;
color: #0f172a;
font-family: system-ui, sans-serif;
line-height: 1.7;
}
.bar {
display: flex;
flex-direction: column;
gap: 6px;
padding: 12px 16px;
border-bottom: 1px solid #e2e8f0;
background: #ffffff;
}
.bar nav {
display: flex;
gap: 14px;
}
.bar a {
color: #64748b;
font-size: 12px;
text-decoration: none;
}
.wrap {
padding: 28px 16px;
}
h1 {
margin: 0 0 8px;
font-size: clamp(26px, 6vw, 36px);
line-height: 1.15;
}
.lead {
max-width: 46ch;
color: #334155;
font-size: 15px;
}
.cards {
display: grid;
gap: 10px;
margin-top: 18px;
}
.card {
display: grid;
place-items: center;
min-height: 88px;
border-radius: 10px;
background: #2563eb;
color: #ffffff;
font-family: ui-monospace, monospace;
font-size: 12px;
}
@media (min-width: 700px) {
.bar {
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 14px 24px;
}
.wrap {
width: min(100% - 48px, 960px);
margin: 0 auto;
padding: 44px 0;
}
.cards {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}