是否可以用这张图片来遮盖 DIV 的形状?
这就是我想要实现的效果:
目前为止,我使用了 SVG 标签,但它并没有给我精确的输出:
代码:
<svg viewBox="0 0 643 525">
<defs>
<clipPath id="shape">
<rect width="150" height="200" style="fill:rgb(0,0,255);stroke-width:5" />
<rect x="160" y="100" width="150" height="100" style="fill:rgb(0,0,255);stroke-width:5" />
<rect x="50" y="210" width="100" height="80" />
<rect x="160" y="210" width="225" height="190" />
</clipPath>
</defs>
<image width="643" height="343" clip-path="url(#shape)" xlink:href="../assets/images/crain.png" x="-50"></image>
</svg>