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
-
Responsive images srcset
Is delivering scaled images using srcset a good idea? Thinking of delivering one image size to Mobile and another to Desktop. How can I do this for all browsers? Thanks Mike
On-Page Optimization | | henandstag2 -
How many images should be optimised for 1 keyword?
Hello Moz, I have a product category page and I have optimised 4 images around 1 keyword - is this bad practice? I worry Google will penalise me. Should I instead optimise them for other keywords? Cheers
On-Page Optimization | | crocman0 -
Home Page Text Placement - In Widget?
My client has a blank homepage that showcases his work in a slideshow. As a result, his homepage will not rank. I've created landing pages and they have started to rank, but he is not a fan of them. He wants to add a widget below the menu, essentially where you have to scroll down to see it (no one will ever see it) with the text/onsite optimization we need to get him to rank. This will leave him with his blank homepage that he likes. My gut reaction is that the text needs to be in the actual page, not a sidebar widget. What do you think? Will this method work?
On-Page Optimization | | columbiaseo0 -
Image heavy pages: Google friendly fonts / seo text etc
Hi Google friendly fonts - are these in wide use now, do they work ? If you have image heavy site do they work just as well as using what we used to call 'seo text'. I have heard that 'seo text' not really used anymore or at least rebranded to 'helpful, informative paragraph or two of body copy about the page with a couple of the pages target keywords in it'. I take it if fonts in image not google friendly then should still ask dev for some space to fit in a para or two of some proper body copy, with couple of pages target kw in it ? Also looking like if i succeed in this request will be below the fold, how hard should i fight for it to be above the fold ? cheers dan
On-Page Optimization | | Dan-Lawrence0 -
Author snippet image in results, question!
Hi, Quick question really, I can see how a Google+ profile picture showing up in the results can increase CTR and even trust but would this be a no no for a normal website? I mean if you had a website which offered personal training, so a brand rather than an individual would you not use this snippet? I've seen some website, even ecommerce sites using this tag to just increase their CTR.
On-Page Optimization | | Bondara0 -
Do alt tags count towards on page keyword density?
Hello...I have written a bunch of content for my site using a useful tool called Scribe SEO which recommends keyword density at 5% if I remember correctly. So all my my newly written content is below this level but I am left wondering if by adding alt tags with my chosen keywords I will be considered to be over the limit and cause a red flag? Can anyone clarify this for me please?
On-Page Optimization | | Wallander0 -
Do images work as a H1
Is a h1 tag wrapped image with a optimized alt tag as effective as text wrapped in a h1 tag?
On-Page Optimization | | EAOM0 -
On page internal link text
Hi, I'm in the process of rebuilding/designing an existing well ranking niche bespoke software site and have the following question - In the footer, I'm planning on linking to the main landing pages (blue widget software, red widget software etc theres about 7 in total). In these links I want to know if its best to have the word "software" in each link as I'm scared of it looking spamy. We sell custom software, and a lot of the keywords that currently attract traffic (as reported in analytics) end in the word software, for example - blue widget software red widget software In the footer would you end each link with software or not? How much effect would this have on rankings? Thanks in advance.
On-Page Optimization | | JamesJacobs0