When building responsive websites I sometimes use background images to render an appropriate image for the appropriate screen size.
eg:
#image {
background-image: url(largeimage.jpg);
}
@media only screen and (max-width: 320px) {
#image {
background-image: url(smallimage.jpg);
}
}
To let screen readers know what kind of element we are dealing with I add
role="img"
And an
aria-label
Here is my question:
I've always learned that it's better for SEO to add an image like a company logo in an actual image element.
eg
<img src="logo-companyname.png">
The reasoning is that the logo will show up when Google image searching on the company name. (presuming the website is ranked well enough)
Will Google still "scrape" the logo when implemented as a div? eg
<div id="logo-company" role="img" aria-label="company name"></div>
Or do I still need to add an image somewhere to get the desired result? Does Google do anything at all with the screen reader tags for that matter?