示例工程 25-responsive-images

25-responsive-images/app/assets/wide.svg

xml · 0.8 KB

运行:响应式图片与媒体

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="500" viewBox="0 0 1200 500" role="img" aria-label="占位产品图 1200 × 500 横幅">
  <defs>
    <linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
      <stop offset="0" stop-color="#7c3aed"/>
      <stop offset="1" stop-color="#db2777"/>
    </linearGradient>
  </defs>
  <rect width="1200" height="500" fill="url(#g)"/>
  <circle cx="864" cy="150" r="90" fill="rgb(255 255 255 / 22%)"/>
  <rect x="120" y="290" width="528" height="80" rx="15" fill="rgb(255 255 255 / 85%)"/>
  <text x="120" y="350" font-family="ui-monospace, Menlo, monospace" font-size="42" fill="#1e3a8a">1200 × 500 横幅</text>
  <text x="120" y="200" font-family="ui-monospace, Menlo, monospace" font-size="30" fill="rgb(255 255 255 / 90%)">responsive image</text>
</svg>