- Links don't work if we are embedding the svg using
img
tags, but using object
they work.
<object data="../examples/links.svg" type="image/svg+xml"></object>
<svg viewBox="0 0 300 100" xmlns="http://www.w3.org/2000/svg">
<a href="https://rust.code-maven.com/" target="_blank">
<text x="5" y="15" fill="red">Rust</text>
</a>
<a href="https://perlmaven.com/" target="_blank">
<circle cx="40" cy="40" r="15" fill="blue" />
</a>
<defs>
<linearGradient id="grad1" x1="0%" x2="100%" y1="0%" y2="0%">
<stop offset="0%" stop-color="#4B8BBE" />
<stop offset="100%" stop-color="#FFD43B" />
</linearGradient>
</defs>
<a href="https://python.code-maven.com/" target="_blank">
<rect width="80" height="40" x="0" y="60" fill="url(#grad1)" />
</a>
</svg>