I manage several websites, one of which is an e-commerce site with a lot of images. At the top of some product category pages, there are image links to specific products (think image banners).
I am curious how others handle images as links and what SEO considerations you make when doing so? Specifically, there are 2 ways one can code an image link:
- The image can be the background of the actual anchor tag, like so:
<a href="thelinkaddress.com" title="Visit My Link" style="background-image:url('link-image.png');background-size:100%;display:block;">My Image Link</a>
- The image can be contained within the anchor tag as another HTML element:
<a href="thelinkaddress.com" title="Visit My Link"><img src="link-image.png" alt="My Link Image"/></a>
#1 The image can be the background of the actual anchor tag, like so:
<a href="thelinkaddress.com" title="Visit My Link" style="background-image:url('link-image.png');background-size:100%;display:block;">My Image Link</a>
#2 The image can be contained within the anchor tag as another HTML element:
<a href="thelinkaddress.com" title="Visit My Link"><img src="link-image.png" alt="My Link Image"/></a>
My understanding is that method #1 will not index the image with a search crawler because it is considered a style, but I suspect that text content is more important to a search crawler than an image with alt
text.
Does anyone have insight into how either way impacts the SEO of a web site?
Thank you