One SEO professional asked John Mueller about handling CSS background hero images.
The SEO pro explained: they have typical homepage features – such as a hero image. The hero image is embedded not with the image tag, but rather as a background image.
With this, it lacks the ability to add an alt attribute to describe the image. It’s possible there are some technical aspects as to why the agency used this approach for us.
But they are wondering: what is the recommendation if you want to have the image indexed so that it is available on image search on Google? Also, they wanted to know how Google determines if the image is embedded as a background image and its relevance.
Can Google also detect that there is no way to put this behind the image?
John explained that if you’re using something like a CSS background attribute to display an image, then Google would not pick this up for image search.
It’s possible it may have changed recently, but as far as John knows, this is how it is still handled.
In the past, Google would only focus on the image tag, and the source attribute of the image tag. And if you had a picture element, that’s still within the same thing.
The other option was, if you link to an image file directly, then Google would also be able to pick that up for image search.
But, if it’s purely a CSS background image, then Google at least didn’t pick this up in the past. And it sounds like this is still the case.
One thing you could potentially do to embed an image is make sure that it’s at least linked to from the page itself, particularly if you care about it for image search.
Sometimes, it’s not critical for that image to be findable in image search.
If you have something like a decorative image of your company’s headquarters or something, then in image search, it’s going to be rare that someone actually searches for that.
This is something where if you want some traffic from image search, then you need to make sure that you implement images on your page in a way that Google can read it.
This happens at approximately the 53:42 mark in the video.