Textmarker Highlight Effect (Stretch SVG over width of a span element)
Hey there! I want to make an animated text marker highlighter effect for headings on my website. I made some SVG's that I can animate using
Here is my code so far:
stroke-dashoffset, but if I have more than one short word, the SVG only centers in the text but does not grow in width. I tried setting width/height and some other attributes, but when it grows in width, the height grows to preserve the aspect ratio and overflows to the bottom of the span. Can anybody tell me how I can make the SVG "fill"/"stretch" in the width of the container? (Any other improvements of my code are appreciated too.)Here is my code so far:
