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
-
IMG ALT tags - should they be the same or the product title?
I have about 300 products. Should I make all my IMG ALT tags with my keywords, such as sea glass jewelry, sea glass necklace, sea glass bracelets? Or, should I make them what their title is, some of which do not pertain to the keyword, such as By the Sea. Some of my products do have keywords in them, but not all. I am hesitant on changing all the titles, as almost all URLs are indexed.
On-Page Optimization | | tiffany11030 -
Link anchor text in list menus
Obviously Google likes descriptive anchor text. At least the first version on the page. But suppose you had a list of scrap yard depots on a hover site menu, would you go for the person friendly nested list, so Scrap Yard Depots Newcastle Chester Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch Or the presumably more Google friendly; Scrap Yard Depots Newcastle Scrap Yard Chester Scrap Yard Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch Scrap Yard
On-Page Optimization | | JamesFx0 -
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 -
Why DoFollow & NoFollow Attributes on Same Internal Text Links?
I want to know that, why SEOmoz have defined DoFollow & NoFollow attributes on same internal text links? Please, find out attachment to know more. Left bar have On-Page / Site Optimization link with dofollow attribute but, right section have nofollow. So, why should they have apply on DoFollow or NoFollow attribute on same text links? 6806571615_138b8765fd_b.jpg
On-Page Optimization | | CommercePundit0 -
On-page: Over optimized images?
Hello guys. I have a small question about an on-page optimization for images. What I have: good title tag / good url structure good content (NOT keyword shuffled, its real content, for real people) images / gallery uploaded to folder named same as article name. For example: Great tips for bloggers [article name], great-tips-for-bloggers [folder name]. So my question is: Will Google harm me for this "too good" paths to images, article related image filenames, with mask like [gtips-img01], and if all images have titles / alt tags? Thank you guys.
On-Page Optimization | | infoo130 -
Does link text "more information" have more weight than a normal link?
Does the anchor text "more information" hold any additional weight than any other anchor text? My suspicion is no, but just wanted to confirm.
On-Page Optimization | | nicole.healthline0 -
Anchor text, same page, different kewords to same URLs
Could someone please tell how Google treats the use of anchor text from a single page when using different keywords that all point to the same URL. So for instance I am doing a blog post and use the following anchor text which all point to the same URL: Cool Widget >> www.domain.com/widget Awesome Widget >> www.domain.com/widget Mighty Widget >> www.domain.com/widget I have read that Google will only take noticeof the first one? Thanks
On-Page Optimization | | blagger0 -
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