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
-
H1 text and Header Image Overlap?
I have images with text at the top of every page on my site. But no H1 or H tags at all. I would like the text on the image to be my H1 text. But I don't want to be repetitive. What should I do?
On-Page Optimization | | Calligraphy0 -
Optimal amount of alt and title tags on a landing page?
Hey guys! We are preparing a few product landing pages and want to make sure the alt and title tags are done correctly. We looked at landing pages from Apple and Google Nexus and found that they had very few alt and title tags (or none). Are we missing something here? Should there be an alt for every image and title for every link?
On-Page Optimization | | TVape0 -
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 -
Html text versus a graphic of a word
Hello, How much better for rankings is an html text heading (H1 text of a word at the top of a page) than a graphic of the word with an alt tag? Thank you!
On-Page Optimization | | nyc-seo0 -
What's the best way to name an image for SEO?
Hi Guys,
On-Page Optimization | | krseo
I'm thinking about images and SEO. What's the best way for naming and using images in HTML Code? For example: Image-Name: keyword-keyword2-keyword3.jpg or keywordkeyword2keyword3.jpg ?
How many Keywords should I use max for a picture? And also do you use the alt tag as description of the image and the title tag or only the alt tag? If you use the title, what do you use it for? Maybe someone can copy a HTML-Code example for me 😉 Thank you 🙂
Alex0 -
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 -
What is the best way to make use of internal anchor text links without appearing to be a 'spammy' webpage?
I've recently been spending some time going through all the content on our website, henstuff.com, adding internal anchor text links to product copy with the link following back to the product's generic catagory. I've been focusing on the search term 'hen party accessories', but have also been using 'hen do accessories' and 'hen night accessories'. I know that internal linking has value when it comes to SEO and rankings, but was keen to find roughly at what point usage of a certain search term for anchor links is seen as spam by the engines. Is there a certain formula to follow when it comes to internal anchor text links? You can see some examples at: http://www.henstuff.com/hen-night-accessories/hen-party-accessories/willy-bubbles http://www.henstuff.com/hen-night-accessories/hen-party-devil-horns/hen-night-pink-devil-horns Many thanks Oli
On-Page Optimization | | RobertHill1 -
Image files names - should each be different ?
Hi SEOs I have created a page on my website with a certain tutorial - let's say "How to change a tyre in your car". I have Grade A from On-page report using SEOmoz tool. I have put a relevant alt description for each photo I have put in that tutorial and I have used relevant keyword as a name for each image. So for example this would look like that: changing-tyre-1.jpg changing-tyre-2.jpg My question is should I name these file differently according to their content ? For example if on my photo there is some tool I have to use to change the tyre should the file have the name relevant to the subject of the article/tutorial on the page or to the content of the image ? Is that a stupid question ? Or am I getting too fussy ? Thanks
On-Page Optimization | | lolskizz0