There are a wealth of techniques for implementing image replacement with background images, but I find myself using inline SVG more and more (primarily because I can manipulate its components with CSS).
However in places (like links and headers) where text content is important for SEO, SVG alone doesn't cut it. Are there any equivalent techniques in the wild allowing text within a header or anchor to be visually hidden whilst leaving inline SVG unaffected.
Note: I know that Google does index SVG, but it seems quite arbitrary, even with liberal usage of <title> and <desc>.
I can only suggest the following based on this article by Chris Coyier at CSS-Tricks.com
Reference Article
First, define your SVG
..but the hide it with
display:none;Use a standard div (or element) with an absolutely positioned child of 100% size.
Then add a SVG
useelement inside the absolutely positioned childCSS (so far) would look something like this.
then you can add addtional styling as follows
Codepen Demo