I am developing a custom SVG editor application and facing an issue with implementing a highlighted effect when an <image>
element is clicked. I have successfully accomplished this for other elements like <circle>
by adjusting attributes such as stroke
, stroke-width
, and stroke-dash-array
. However, applying these changes to the <image>
tag directly or through CSS styling does not seem to be effective. Even trying the border style did not yield the desired result. How can I resolve this?
As per information from MDN, <image>
should support global attributes, including presentation attributes, which implies that it should work correctly. Additionally, inspecting the <image>
element in a browser reveals that it follows the box model and should be highlightable.
<svg viewBox="0 0 1370 1170" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<image width="128" height="128" x="617.9207153320312" href="data:some-valid-link" style="stroke-width: 3px; stroke-dasharray: 7px;" stroke="#3aa2c2"></image>
</svg>