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
-
Clickable Images Question
This may seem like a minor issue but it is something that has been bothering me. When I write a blog post and place images within the text, is it better to have the image linking to nothing or link to the image url. I am guessing that unless I wish the image to rank for a certain keyword then it is not worth it linking to the image url. But would just like clarification if there is a more deep seated reason. Thanks Mark
On-Page Optimization | | markmiton0 -
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 -
OMG! does Google really consider text-decoration:none as a hidden link?
So I was reading this article today https://www.mattcutts.com/blog/hidden-links/ Can setting a link to the same color as regular text and applying text-decoration:none really be considered a 'hidden link'?
On-Page Optimization | | cbielich0 -
How to ALT tag correctly many similar images?
scenario: I have a product page with some text about the product and 12-15 different images af the product: details, colours, different views... how should I name an alt tag them correctly, been them actually really similar? Is it keyword stuffing to use the same name containing a relevant keywords?
On-Page Optimization | | DavideM0 -
Optimisation for Google Images
What techniques do you use for the optimisation of images on Google. Alt tag , image title Surrounding text Anyone tested actual linking to the image url and not the page url. I have achieved hundreds of top listed images but when it gets competitive what is the most useful technique you have used. Thanks
On-Page Optimization | | onlinemediadirect0 -
Page Analysis on our asp.net site is showing the following for HTML Text - //
paintball-online.com This is consistent on every page, despite these pages having text. I assume the SEOMoz tool is working just fine and we have a coding issue that may be hindering our SEO efforts. Any ideas/suggestions? Thanks
On-Page Optimization | | Istoresinc0 -
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 -
Lots of links on homepage to internal pages with keyword rich anchor text - problem?
Hi, All! We have a new potential client, that when looking at his site with a tool, we noticed that the previous SEO company they worked with filled the homepage copy with lots of keyword-rich anchor text links pointing to different pages on the site - many links going to the same page, just with different keywords. These links are not indistinguishable in format from the other text, which is why we only noticed it with a tool. I certainly wouldn't recommend doing that to start with, but once all these links are there, would you recommend taking them down? Is there any conceivable chance it could help the site? Is there a significant reason to think it will harm the site? Or will it just be pretty neutral? In all that's been written (much by SEOMoz) about only the first link's anchor text counting, do subsequent links work like a no-follow in the sense that they are a waste of the link-juice of the page, or is it as if they aren't there at all? (And is "only the first link counts" still the most widely held theory, or have there been new developments since?) Thanks, All!
On-Page Optimization | | debi_zyx0