Incorporating SVG icons into my website brought me to this script: https://github.com/tiagoporto/jquery-svg-to-inline
The script worked perfectly.
To display the icon properly, I enclosed it in an <a>
tag:
<a href="https://open.spotify.com/" target="_blank" class="svg-link"><img src="<?php bloginfo('template_url');?>/svg/play-white.svg" class="svg"></a>
However, this setup resulted in a visual issue. When inspected with Firebug, I noticed overlapping elements highlighted by <svg></svg>
.
The gray area was set to a height of 60px, matching the size of the SVG. Despite no margin or padding, the orange part extended above the gray section. One solution I considered was applying overflow:hidden to the gray div, but I am curious if there is a more elegant approach to limit the link's size to match that of the SVG itself.
Your insights and suggestions are greatly appreciated!