Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html SVG上的破碎背景图像_Html_Svg - Fatal编程技术网

Html SVG上的破碎背景图像

Html SVG上的破碎背景图像,html,svg,Html,Svg,我被要求在.html页面中添加一个大的SVG文件。它有背景图像,但不显示 这是与背景图像相关的代码行: <defs> <clipPath id="a"> <path fill="none" d="M0 0h1920v1080H0z"/> </clipPath> </defs> <g clip-path="url(#a)"> <image width="1920" height="

我被要求在.html页面中添加一个大的SVG文件。它有背景图像,但不显示

这是与背景图像相关的代码行:

<defs>
    <clipPath id="a">
        <path fill="none" d="M0 0h1920v1080H0z"/>
    </clipPath>
</defs>
<g clip-path="url(#a)">
    <image width="1920" height="1080" xlink:href="https://i.imgur.com/Hws1Jb8.png"/>
</g>

指向图像的链接:

SVG的其余部分显示得很好,但在背景应该位于的位置,有一个大的“断开的图像”图标位于所有内容的后面


我如何让背景在这里工作?我在本地使用了它,并且使用了
xlink:href=“images/bg.png”
但是出现了相同的断开图像图标

我已经将您的代码放入了svg
元素中,以及您需要将图像转换为数据URL的所有内容。