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
-
Combining adjacent image and text links
Hey, The pages on one of our sites has a lot of links on it, which I have read a couple of times can be bad for SEO, although many say don't worry too much about it. However, I was thinking to reduce links and also reduce code size combining adjacent image and text links. For example they current look like this:
On-Page Optimization | | mdeluk
"
Products page" I am thinking maybe I should change to the following:
"Products page" However, is this bad code and therefore could be bad for SEO? I have tried Googling this but couldn't seem to find anything on it.0 -
Wordpress photo blog with sparse text - noindex posts, index categories?
Hi everyone, I have a wordpress blog that is heavy on photos but short on text - most of my posts consist of a photo linking to a full gallery, and a short description of 1-4 sentences. I've often read recommendations to noindex category pages, but in this case I'm wondering if it might be best to noindex the individual posts instead - I'm concerned that the short posts might seem like thin content to Google compared to the category pages which aggregate the posts. Also, some of my categories reflect keywords that I'd like to rank well for. I have about a dozen categories and close to 1000 posts.
On-Page Optimization | | matt_b0 -
Good idea to use hidden text for SEO purposes due to picky clients not allowing additional content?
I do SEO for eCommerce websites both in-house and for clients. A few of our clients want increased rankings but are not willing to allow us to make the changes internally to help make that happen. One of which is adding content to the webpages since 90% of them have very little to none. I have a couple clients that are extremely picky about what can be seen on their eCommerce website. They have the site setup the way they want it but it is not SEO friendly in the slightest. The pages (including homepage) have little to no content, and the only things they want changed are things visitors CANNOT see on the webpages (META, ALT Tags etc). The tactic i am wanting to use is often used by spammers but i have a legitimate reason to use this and wanted to know if this would be a good idea. They are wanting to target fairly competitive keywords but are unwilling to allow any on-page changes to add any information and keywords to help with rankings. I was thinking about adding text behind images or hide the text in whatever ways to prevent the end user from viewing it (except for the search engines). My idea was simply to add a paragraph or two of content for the search engines purely to help in ranking because they have a lot of pages that have zero content except for product image and title listings. Is this tactic recommended or does anyone have any other ideas for these type of situations. Thanks,
On-Page Optimization | | VITALBGS
Stephen0 -
Keyword Stuffing in Alt Tags!
Hello, I have on a main page over 50 images. The first page i want to optimize it for MAINKW (let's say). Now, if i use in the alt tags "MAINKW KW1", "MAINKW KW2", "MAINKW KW3" ... "MAINKW KW50" then Google may say that i stuff the MAINKW in that page? Those images are reprezentative for main Categories and i have direct links to them from the main page with the anchors KW1, KW2...KW50.
On-Page Optimization | | VertiStudio0 -
Page Analysis on our asp.net site is showing the following for HTML Text - //
paintball-online.com This is consistent on every page, despite these pages having text. I assume the SEOMoz tool is working just fine and we have a coding issue that may be hindering our SEO efforts. Any ideas/suggestions? Thanks
On-Page Optimization | | Istoresinc0 -
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 -
How impactful will text at the bottom of the page be?
If the most important content for humans on my page is images (e.g., a picture gallery), but there is very little text high up on the page, how impactful will a text description at the bottom of the page be? I've seen a few other sites put content paragraphs at the bottom of their pages. LIke so: http://www.purpletrail.com/invitations-online http://www.tinyprints.com/ Is this something I would do well to emulate?
On-Page Optimization | | Ehren0 -
Opinions on Alt tags
Reading around the web, there are many sources that suggest all images should have an Alt tag attributed to them. This is good for accessibility etc, however there appears to be conflicting interests between this and what works for SEO. Hence many other sources suggest that you include a keyphrase or two in 1 image Alt tag, and then leave the rest blank so as not to dilute the alts on the page. In my experience, the latter appears to be true. However this seems wrong when the Alt attribute really should be used for accessibility reasons and not for SEO - why would the search engines encourage us to provide poorer quality information by harming our rankings if we try to make a website accessible? Interested to hear your opinions and experiences on this subject. Thanks.
On-Page Optimization | | RiceMedia0