示例工程 25-responsive-images
25-responsive-images/app/assets/product-800.svg
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" viewBox="0 0 800 600" role="img" aria-label="占位产品图 800 × 600">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#0ea5e9"/>
<stop offset="1" stop-color="#2563eb"/>
</linearGradient>
</defs>
<rect width="800" height="600" fill="url(#g)"/>
<circle cx="576" cy="180" r="108" fill="rgb(255 255 255 / 22%)"/>
<rect x="80" y="348" width="352" height="96" rx="18" fill="rgb(255 255 255 / 85%)"/>
<text x="80" y="420" font-family="ui-monospace, Menlo, monospace" font-size="28" fill="#1e3a8a">800 × 600</text>
<text x="80" y="240" font-family="ui-monospace, Menlo, monospace" font-size="20" fill="rgb(255 255 255 / 90%)">responsive image</text>
</svg>