示例工程 25-responsive-images
25-responsive-images/demo-01-srcset/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;
}
img {
display: block;
width: 100%;
max-width: 720px;
height: auto;
margin-top: 16px;
border-radius: 10px;
background: #e2e8f0;
}
.hint {
max-width: 60ch;
margin-top: 8px;
color: #64748b;
font-size: 12px;
}