3 ms·
I used to only do single file HTML pages too, until I have a page that have multiple occurrences of the same image, it's wasteful to have the dataurl string eve
by slmjkdbtl 3y ago
I used to only do single file HTML pages too, until I have a page that have multiple occurrences of the same image, it's wasteful to have the dataurl string every time that img occurs. Maybe I can save the dataurl string in JS once and assign it to those img in JS, but most of the time my page doesn't have any JS it feels bad to use JS just for this.
- csande17 3y agoYou could use the <use> element in an inline SVG to duplicate the same bitmap <image> to multiple parts of the page.
- slmjkdbtl 3y agoInteresting, I'll try that later. But I guess that won't have some useful attributes on <img> like "alt"?
- oneeyedpigeon 3y agoI found [this suggestion](https://stackoverflow.com/questions/4697100/accessibility-recommended-alt-text-convention-for-svg-and-mathml https://stackoverflow.com/questions/4697100/accessibility-re...), although it's pretty old. Maybe screen readers have made improvements to this scenario in the last few years? <svg role="img" aria-label="[title + description]"> <title>[title]</title> <desc>[long description]</desc> ... </svg>