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
-
How to deal with hundreds of externally-generated images with no alt text?
Hi all This is a good one. I work for a webdev company who has clients in the transport industry. Part of our work on their sites involves pulling in transport-related offers from a feed. This includes both text and images, which our site template turns into viewable pages. The problem is that Moz has flagged that these images don't come with alt text, and there are _hundreds and hundreds of them. _I can't add alt text to them all, there just isn't the time or resources. Besides, the list is updated frequently, and new images are pulled in. So... what do? Would it be prudent to noindex them all by default setting? I'm stuck! Many thanks,
On-Page Optimization | | tomcowles
Tom0 -
Is this still considered true about INTERNAL anchor text? "Penguin seems to be targeting overly aggressive anchor text (both internally and externally), especially from low-quality sources."
Recently I've heard a few people say now it's okay to be aggressive with internal linking. So a link from mydomain.com/news to mydomain/widgets can use spammy anchor text like "best green widgets in California" that are an obvious problem for links coming in from external site. Which is accurate?
On-Page Optimization | | corlin0 -
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 -
Can I use the same text in my meta description as I put in my post excerpt?
Hi, I'm just trying to understand the right way to optimise my blog posts and this is likely a dumb question... but to what extent should the text in my meta description differ from the text in my post excerpts? cheers, Andrew
On-Page Optimization | | seowhiskey0 -
Home page mostly graphic image
I have a new customer that is redesigning her website. The graphic designer has designed a lovely homepage that is mostly an image with some navigation and footer area for text information. My concern is that there isn't any real call to action or anything on the homepage design other than an interesting and fun graphic. It seems like years ago this was a common practice and then later it was looked down on as not good for the user experience or SEO. What is the latest thinking on this type of design? Should the homepage (www.mysite.com) be allowed to be mostly images? Or should we focus on the optimizing the internal pages and let the homepage be more creative?
On-Page Optimization | | ChristiMc0 -
What's the maximum length (number of spaces) for the Alt Image Text?
I'm setting up alt image text for the images on our website and I'm wondering if there is a maximum number of spaces that should be used that field.
On-Page Optimization | | JillCS0 -
Nowadays is it fundamental renaming images for SEO?
Its it fundamental nowadays renaming images for SEO? Many photos are on top positions without being renamed like: mykeyword.jpg but can be 9876986.jpg instead. Doesn't itcount much more the contest in which they are such as text around photos, descriptions and context from internal and external linking pages? Renaming everyphoto, in every gallery can be considered over optimization? Is there any study showing the impact the single factor of renaming a photo in a page? Thanks
On-Page Optimization | | holidaysempire0 -
The SEO and CRO Value of an Image Next to Page Content
If given the choice to add an attractive stock photo to a conversion focused page, do the pros out number the cons in terms of SEO and CRO. Some pros are that you can include the keyword in the image filename and image alt tag. It can also increase user experience by making the page more attractive. Some cons might be that it increases page load time which can have a negative impact on SEO and user expereience. Also the visitor might get distracted away from the lead form button.
On-Page Optimization | | SparkplugDigital0