How can I convert a span to an img

How can I convert a span to an img? -- Can I get some help with HTML? What would I need to do in order to make a span viewed the same way as an img while considering accessibility? I know it’s not semantically correct. Our current circumstances don’t load our img[src] in our screenshots so I was wondering if there are some attributes that I can add to a span with a background-image and have it viewed the same as an img (e.g. alt attribute)? I’m happy to read more into it if someone can point me where to look. My Googling has reached a dead end
2 Replies
b1mind
b1mind2y ago
A background-image will have no weight to a screen reader and be ignored I would be curious to know how you would set a bg img in css easier with a span than using a real <img> tag or what the constraint is rather why you cant' Also background images have no impact in seo either (sometimes that could be what you want to not have it show in a search) Other times you need it to add to rankings (along with good alt text for both readers and bots)
MarkBoots
MarkBoots2y ago
dont know what those circumstances are, but you could do both. wrap a div/span around the img and give that the same background
Want results from more Discord servers?
Add your server