Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


You could use the <use> element in an inline SVG to duplicate the same bitmap <image> to multiple parts of the page.


Interesting, I'll try that later. But I guess that won't have some useful attributes on <img> like "alt"?


I found [this suggestion](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>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: