示例工程 07-backgrounds-borders-shadows
07-backgrounds-borders-shadows/demo-02-shadows/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 12px;
font-size: 28px;
}
.grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 16px;
}
.box {
display: flex;
flex-direction: column;
gap: 4px;
padding: 16px;
border-radius: 12px;
background: #ffffff;
font-size: 12px;
}
.box strong {
font-size: 14px;
}
.box span {
color: #64748b;
}
.border {
border: 3px solid #2563eb;
}
.outline {
outline: 3px dashed #dc2626;
outline-offset: 4px;
}
.shadow {
box-shadow:
0 1px 0 rgb(255 255 255 / 80%) inset,
0 14px 30px rgb(15 23 42 / 18%),
0 3px 8px rgb(15 23 42 / 8%);
}
.inset {
box-shadow:
0 2px 8px rgb(15 23 42 / 18%) inset,
0 0 0 1px #e2e8f0 inset;
background: #f1f5f9;
}