示例工程 37-filters-blend-modes
37-filters-blend-modes/demo-02-blend/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; }
.scene {
position: relative;
height: 240px;
max-width: 640px;
margin-top: 16px;
overflow: hidden;
border-radius: 12px;
background: linear-gradient(135deg, #1d4ed8, #7c3aed 55%, #be185d);
}
.c {
position: absolute;
width: 120px;
height: 120px;
border-radius: 50%;
}
.one { top: 30px; left: 8%; background: #fbbf24; mix-blend-mode: multiply; }
.two { top: 78px; left: 34%; background: #22d3ee; mix-blend-mode: screen; }
.three { top: 24px; right: 8%; background: #f472b6; mix-blend-mode: difference; }
.type {
position: absolute;
left: 50%;
bottom: 14px;
transform: translateX(-50%);
margin: 0;
color: #ffffff;
font-size: 34px;
font-weight: 800;
letter-spacing: 0.1em;
mix-blend-mode: overlay;
}
.bb {
max-width: 640px;
height: 120px;
margin-top: 18px;
border-radius: 12px;
background-image:
linear-gradient(135deg, #2563eb, #7c3aed),
radial-gradient(circle at 30% 30%, #fbbf24, transparent 60%);
background-blend-mode: overlay;
}
.hint {
color: #64748b;
font-size: 12px;
}
@media (max-width: 560px) {
.c { width: 90px; height: 90px; }
.type { font-size: 24px; }
}