Background Images and ALT text
-
We pretty much exclusively use background images for our sites. How do I add in alt text? I tried a Google search for this issue and the best answer I could find was "Use the 'title' tag in the containing div", but that was from 2010.
Is there a better way to do it? And no, we're not going to switch to using standard images, because background images are way more slick for UX.
-
Does it has any positive effect on ranking? (seo)
-
You can't use ALT text to background images.
If your images are loaded as img tag then you have title, alt. Example:
But background images isn't regular images loaded with img tag. They can be loaded only with CSS styling. And therefore they doesn't comes with title and alt. Example:
As you can see you can't use title or alt for image there. Only way is to define title as this:
or better this one:
I know that isn't 100% background but also helps.Alternative way can be ARIA. If you love background images but really wish alt text you can use WAI-ARIA and define them as:
...
But GoogleBot doesn't support aria-label for now. -
Yes for screen readers and using it as alt and title for your images that are there. So you are not trying to trick Google, you are trying to figure out a way to mark what is actually there. For google image search, I have had success ranking images even if used as backgrounds in divs by naming them with what I was trying to rank them for. Since I could not use alt or title I named images with my target in them. These images were all for a brand query.
Example: image on mybrand.com named mybrand-imageName.png
we were able to get most of those images to show up when doing an image search for mybrand
-
I'm going with "Google is too smart for that" on the transparent image alt text front. I guess it would help out people using a screen reader, but I'd like to get some of the images into Google image search. It seems like alt text is pretty much required to rank for that?
-
I think that adding title to the div is the only way for you to do a background image in CSS.
You can cheat a little by then loading a transparent image in the container that the background image is in, make this transparent image have an alt tag and title tag for whatever your background image is about.
If you are doing this for seo purposes this should work, if you are doing it to have the html well formatted, there is only the div tag.
Cheers!
-Erick
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Combining adjacent image and text links
Hey, The pages on one of our sites has a lot of links on it, which I have read a couple of times can be bad for SEO, although many say don't worry too much about it. However, I was thinking to reduce links and also reduce code size combining adjacent image and text links. For example they current look like this:
On-Page Optimization | | mdeluk
"
Products page" I am thinking maybe I should change to the following:
"Products page" However, is this bad code and therefore could be bad for SEO? I have tried Googling this but couldn't seem to find anything on it.0 -
Use of trademarks in tags and text
Does Google spider read registered trademarks (the 'R' or 'TM') or do these marks impede anything if they are featured in meta tags or text?
On-Page Optimization | | KnutDSvendsen0 -
Images, using a lightbox would it go against adsense TOS?
Something I have been trying to figure out. On my website each member can have up to 10 images. When viewing a profile you can select each different photo and we currently use javascript to display this in a small box so the page does not re-load. I am curious for ideas, would we be better off having the images load on a different page? Giving more pages per visit in GA or would a lightbox type pop up be optimal. My concern is that the lightbox (similar to how Facebook displays images) would be a violation of google adsense TOS. I tried to talk with a help desk member from google regarding this but I am not even sure they could speak english to understand what I was saying. What do you guys think? When it comes to handling groups of images how would you best display them for user happiness and search engine optimisation?
On-Page Optimization | | Burto0 -
SEO Location Pages - ALT Image Tag Question
Hello Guru's, I have a Hire Website whereby you can rent products online. I have created different Location pages for these which are in essence the same pages page but with different location specific urls, title tags , on page content etc etc. This helps me to rank for local search. These location pages also display 20 products per page. My question is Should I make the ALT IMAGE TEXT location specific for each of the 20 products . Example - Steam Cleaner Rental in "location" or should I only amend a few of the Atl Image Texts to be location specific. I don't want to come accross as spammy in google eyes but I also don't want to be seen as having duplicate content , images etc etc What do you think ? thanks Sarah.
On-Page Optimization | | SarahCollins0 -
Image Alt and Title?
I'm building a quotations website. Each quotation will have between 1 and 5 images (picture quotes) associated with it. The images will be featured as thumbnails (image gallery) on the quote post itself. How should I handle the image alt and title tags so that I rank better for a quote in image search, and also strengthen the ranking signals on the quote post itself? Take for example, a photo of a beach and a photo of the sun. Both have the same quote on it: "Laughter is an instant vacation." Should the quote itself go into the alt tag? while the description of the image goes into the title? Or should the quote go into the title? Would this be correct? Title: Beach with children playing in the sand. Alt: "Laughter is an instant vacation." Title: Sun shining in the sky. Alt: "Laughter is an instant vacation." What about if the quote is very long? Google has said they like when the alt and title tags are short.
On-Page Optimization | | JABacchetta0 -
Is there a recommended character limit for alt text tags?
I've searched around for a maximum number of characters to use when writing alt tags, but not seeing anything more than "don't keyword stuff." Is there a recommended number of characters?
On-Page Optimization | | KimCalvert0 -
What's the maximum length (number of spaces) for the Alt Image Text?
I'm setting up alt image text for the images on our website and I'm wondering if there is a maximum number of spaces that should be used that field.
On-Page Optimization | | JillCS0 -
Image alt attribute vs. plain text in link?
I'm building a product category browsing page for a high-falutin' jewelry retailer where we display only product photos linking to individual product pages, without any text in the links. From an SEO and link-juice-passing perspective, is it most effective to embed the product titles as the alt attribute in each image, or to leave alt="" and use text substitutions (i.e. an inner which is css'd to display: none) within the <a>to help search engines accept my product titles as the link text with the most credibility?</a>
On-Page Optimization | | cadenzajon0