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
-
HTML Copy in Image Alt Text Field
Hi all, A quick question regarding HTML copy in Image Alt Text fields. An extended client has some landing pages containing infographics, but contrary to our recommendation - no intro copy or surrounding copy was used. The infographic was simply placed on the page, and all of the text of the infographic was placed into the Image Alt Text field. As far as I know, Google would still see that content in the Alt Text field and attribute it to the Infographic, although this would not be sufficient enough of an effort for the page to rank for any of the content used in that field. I'd just like to check that I am correct? And as a consequence - we should insist that they include some copy with the infographic, or alternatively, use HTML text overlays on the infographic instead of flat text in the image itself? Thanks!
On-Page Optimization | | Saatchi_HU0 -
How to find all broken images?
Are there any free tools that will crawl a full website and report back on any broken tags? My site recently added several thousand previously archived posts, many of which contain old tags that no longer exist. ScreamingFrog's crawl is too limited to reach most of these posts, and I haven't been able to find another free tool to get the job done. If there's no free tool, does anyone know of an affordable paid alternative?
On-Page Optimization | | WebElaine0 -
Is the HTML content inside an image slideshow of a website crawled by Google?
I am building a website for a client and i am in a dilemma whether to go for an image slideshow with HTML content on the slides or go for a static full size image on the homepage. My concern is that HTML content on the slideshow may not get crawled by Google and hence may not be SEO friendly.
On-Page Optimization | | aravinn0 -
Image Alt For Logo
I've just run an on page audit of my website www.octopus-hr.co.uk and it seems in reasonable shape. However, I wonder whether I'm missing a trick with the Image Alt for my company logo. The logo appears on every page and links back to the home page. Currently the Alt tag is just the Company name "Octopus". We develop HR Software and we would love to rank better for the term "HR Software". Is it legitimate to change the alt tag to "Octopus HR Software" for my logo or is considered spam and likely to get us hit with a penalty? Thanks in advance David
On-Page Optimization | | davidoff5744440 -
Image Alt and Title?
I'm building a quotations website. Each quotation will have between 1 and 5 images (picture quotes) associated with it. The images will be featured as thumbnails (image gallery) on the quote post itself. How should I handle the image alt and title tags so that I rank better for a quote in image search, and also strengthen the ranking signals on the quote post itself? Take for example, a photo of a beach and a photo of the sun. Both have the same quote on it: "Laughter is an instant vacation." Should the quote itself go into the alt tag? while the description of the image goes into the title? Or should the quote go into the title? Would this be correct? Title: Beach with children playing in the sand. Alt: "Laughter is an instant vacation." Title: Sun shining in the sky. Alt: "Laughter is an instant vacation." What about if the quote is very long? Google has said they like when the alt and title tags are short.
On-Page Optimization | | JABacchetta0 -
Anchor text filters
I am using text replace on a blog to automatically link keywords in posts and pages back to the homepage. Sometimes the same KEYWORD links back 2/3 times in one post, can this harm rankings or cause an anchor text filter? thanks,
On-Page Optimization | | babyjane0 -
Anchor text on outbound links on a blog, relevancy detrimental or positive?
We have a blog related to computer support, and we have been using guest posts and promotion of those posts to boost freshness and rankings of the blog. We have been restricting outbound links to prevent words such as 'computer repair, 'computer support' etc, because we were under the impression that if we want to rank for those words, we should only allow INCOMING links with that anchor text, and that outbound links from the page, would rob the other parts of the site of the link juice this page provides. My question is, is this wrong? Should I freely allow outbound links on my blog page that contain anchor text that I my self am trying to rank for? Or was I correct initially? Current the anchor text is in 'related' industries, such as mobile apps, technology news, etc...things that google might think are 'related', but not exactly what the site is about.
On-Page Optimization | | ilyaelbert0 -
How to get Google images traffic?
How to get Google images traffic? Take a look at traxnyc.com and sugest what we can improve. Thanks in advance.
On-Page Optimization | | DiamondJewelryEmpire0