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
-
Can I put the company name in the image alt text instead of just the service type im trying to rank for?
Hello, if I am trying to rank for a service type and the exact phrase is in the companies name, can I put the company name in the image alt text instead of just the service type? Seizing the opportunity to get another mention of the businesses name...two birds with the one stone if you will... For example, "lawn cutting" being the service type but the company's name is Paul's lawn cutting. Could i put Pauls Lawn Cutting in the image alt text, or just stick to lawn cutting? Thanks in advance
On-Page Optimization | | Gavinn0 -
How to change images of a page without loosing ranking?
Hi, I have two reasons to change some images of a page on a wordpress site: 1.Google speed service advise me to optmize the images size to better spead load times. 2.I want to change images titles (to improve seo optimization for the page keyword), so i need to replace them, since im using wordpress. Now the question is: Can i just change the images without worring about any related seo issues? Or should i follow some best practice to change images in order to not affect the ranking of the page? tx for your support!
On-Page Optimization | | Dreamrealemedia0 -
Ranking for a word when your image is showing up as #2?
I'm trying to rank for several specific words in my industry. I've noticed that many of the pages I'm trying to rank for the specific words, the main image of the page is being ranked. So my question is should I still try to rank my page even though the image is ranking as the first image displayed in the google results. Will this count against me by Google if I do? Or should I try to make the image being ranked more enticing for google searchers to try to increase traffic? Right now the images are not generating many clicks.
On-Page Optimization | | mr_w0 -
How should a ALT TAG Be?
Hi All, Can a ALT Tag have special characters? Can i have my ALT Tag as Image-explained-with-what-it-is? Can i have - hyphens as this? Thanks I have a 2nd question I have 100's of videos which has a ALT tag as Tumbnail link to video How can i deal with them? Can i add the Video title as ALT Tag? thanks
On-Page Optimization | | Nettv0 -
Why Aren’t All My XML Sitemap Images Indexed in Webmaster Tools?
Hi, Here is our main sitemap http://www.vistastores.com/newsitemap/main_sitemap.xml We have submitted all category wise sitemap having Image Tags : For eg - Ac Category http://www.vistastores.com/newsitemap/window_ac_sitemap.xml contains iamge tag - image:imageimage:locimage:captionimage:title</image:title></image:caption></image:loc></image:image> All our 142 category pages includes these format. Still the sitemap report on 4-Apr-2013 says: Sitemaps content Web pages:
On-Page Optimization | | CommercePundit
Submitted 14,569
Indexed 11,219 Images:
Submitted 21,442
Indexed 11,762 You can see major difference in submitted v/s indexed. I have looked into Jay Simpson question - http://www.seomoz.org/q/any-idea-why-our-sitemap-images-aren-t-indexed to find this answer but didn't get Perfect & clear answer. I need urgent answer to fix this issue..... K0NDuw5s.jpg0 -
Do you think using accordion text can hurt SEO?
I have a lot of text for my home page. My plan is to a J Query Plugin for accordion text. Does anyone think that this can hurt SEO efforts?
On-Page Optimization | | DTOSI1 -
Alt attributes same as jpg name and keywords?
Hi everyone, Quick question: Is it better to have your jpg name and alt text slightly different to your keywords for that particular page, or is it better to have them slightly differently? At the minute I'm doing them all with a variation on the keyphrase I want to optimize for (long tail and all that...). Any input much appreciated!
On-Page Optimization | | CMoore850 -
Alt tag matching product titles - e-commerce
Hey all, Just wondering if it is ok to match the alt tag to product titles. Imagine an e-commerce site that lists a whole lot of products on any one page for any one category. Each product listing has a thumbnail image beside it. The easiest way to implement this dynamically is to use the product title for the alt tag. Anyone had any experience with this? Is it overkill / spam of keywords - given that the product title is repeated. Our current situation is that our alt tags are simply blank or say 'photo' which is no good, and we have hundreds of thousands of pages. Cheers, Croozie
On-Page Optimization | | sichristie0