简体   繁体   中英

best practice for a thumbnail alt tag that links to a larger image

So I have a gallery full of thumbnails and each of them links to the full size image. how the alt tag should be implemented? I want search engines to find the large images using the text I provide in alt tag. Code is attached as below.

 <div class="thumbnail"> <a href="images/mustang1969.jpg"> <img src="images/mustang1969s.jpg"/> </a> </div> 

If you want your thumbnails not to show up in google image searches, you can create a common naming convention for your thumbnails that then matches a disallow pattern in you robots.txt.

 User-agent: Googlebot-Image
 Disallow: /*-thumb.png$  

This way you can still put alt tags on your thumbnails to help with screen readers and things like that, but they will not show up in google image results. Furthermore, if you set the user-agent to Googlebot-Image, then you can preserve the metadata of the thumbnail's alt tag for use as organic content for your page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM