Answer the question
In order to leave comments, you need to log in
How to place an image on the background in the marked area of svg?
<html lang="ru">
<body>
<svg width="1200px" height="260px">
<pattern id="img1" patternUnits="userSpaceOnUse" width="1200" height="260">
<image xlink:href="00080028.jpg" x="0" y="0" width="1200" height="260" />
</pattern>
<polygon
points="40 200,40 40, 1160 40,1160 200, 580 250, "
style="fill:#img1; fill-opacity:0.5; stroke: black;" />
</svg>
</body>
</html>
<!DOCTYPE HTML>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" width="900px" height="300px">
<pattern id="img1" patternUnits="userSpaceOnUse" width="900" height="300">
<image xlink:href="pic.jpg" x="0" y="0" width="900" height="300" />
</pattern>
<polygon
points="40 200,
40 40,
860 40,
860 200,
430 250,
"
style="fill:url(#img1)"/>
</svg>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
I can offer my example
Or advise:
Save the svg to a file with the extension .svg
And put it on the background using background: url(... .svg) center no-repeat;
*
<svg width="1200px" height="260px" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="img1" patternUnits="userSpaceOnUse" width="1200" height="260">
<image xlink:href="http://cdn.wall-pix.net/albums/people-models/00030952.Sao.Paulo.Indy.300.jpg" x="0" y="0" width="1200" height="260" />
</pattern>
</defs>
<polygon
points="40 200,40 40, 1160 40,1160 200, 580 250, "
style="fill:#img1; fill-opacity:0.5; stroke: black;" />
</svg>
<---- Transfer this to a file and save it as .svg
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question