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
-
High image rank
Hi everyone I have a question and I hope you can help me or at least introduce some moz post to me.I want to have high rank in google image so I use a descriptive alt text and image title. I used related content and keyword for my pictures but there still some issue should I use the exact keyword in my header and content?and repeat them OVER AND OVER ?can you help me with this issue?
On-Page Optimization | | talaabshode20200 -
Alt tags
Do we use our main keyword only for alt tags for all images on the page?
On-Page Optimization | | Timberwink0 -
How can i define a ALT Tag for Youtube videos?
Hello, When i scan with SEMrush it shows all such pages do not have ALT Tags http://img.youtube.com/vi/iJ4pmmRSZxc/hqdefault.jpg What should the ALT be for them and how can i control as we have 1000's of Youtube videos displayed on various parts of our website Thank you
On-Page Optimization | | ktrinkqao120 -
Does having landing page text beneath the products at the base of the page hinder SEO?
I have a site that is capable of hosting the landing page description either above the products under the H1 or below them at the bottom of the page before the footer. I have always chosen to keep the text "above the fold" as presumably this would be crawled sooner in relation to the rest of the page content than had it been at the bottom. However, this means that I can only really write just a few sentences for each landing page - otherwise the products would shift further down the page - and I don't think this is good from a UX POV. Question: If I move the bulk of my landing page descriptions to the text snippet located underneath the products, could this negatively affect my SEO? Text at the bottom of the page is obviously not significant for users, so is there a chance this could be seen as spam?
On-Page Optimization | | Silkstream0 -
Question Re Cornerestone Page And Anchor Text For Internal/External Links
Suppose I create a cornerstone page with the targeted keyword "Dog Collars". I write a dozen articles on various dog collars and point a link from each article to my cornerstone page. Should the anchor text for the links from each of those articles to the cornerstone page be "Dog Collars" or should they vary, but still be relevant to "Dog Collars" for best SEO? Should half of them be "Dog Collars" and the other half various? Also, if I have 12 articles and all of the anchor text is already "Dog Collars", should I go back and change them so that they all don't say the same thing? If hope my question makes sense ... thanks in advance. I will give thumbs up for helpful responses and suggestions 😉
On-Page Optimization | | Humanovation0 -
Is there a problem when passages of text are repeating on varios pages?
Hi Everybody, I am working on travel-pages and there are 4 tours that all start their itinerary in "Manaus", so I have 4 pages containing all a passage of the same text about Manaus. How will Google interpret this? Just pick one of the four pages in relation to Manaus Keywords and index, or index none of them? What should I do, because there is no canonical tag for parts of pages? I'm curious about what you think 🙂 Best regards,
On-Page Optimization | | inlinear
Holger0 -
SEO for Image only posts
Let's say I have a post where I show 25 different wood textures. I start the post with a small paragraph and then I show several images of wood textures linked to an internal or external page. Since I don't use a text link, then I have to rely on alt tags. It would be very difficult to assign a different alt tag to so many similar images, and I guess there would be a risk of keyword stuffing (walnut wood, oak wood, etc). On the other side, if I assign the same tag to all images, then that clearly is keyword stuffing (alt=wood textures). This is just an example, but it applies to most of my posts. What do you think I should do with the alt tags? Thanks!
On-Page Optimization | | enriquef0 -
Seo'ing Sub domains for images
We are currently adding some performance improvement to our websites, to improve user experience. One of the things we are looking at is splitting of images over several sub-domains, to increase the number of images that can be downloaded at the same. We have seen that using key phrases within image names has an improvement in rankings. So, the question is should we create sub-domains as key-phrase.example.co.uk or as i1.example.co.uk? K
On-Page Optimization | | soltec0