大网数据广告活动
网站运营与故障问答

Why Google is indexing Thumbnails and not Large images?

· 52CE 我爱测

I have a page full of thumbnails, when clicked it opens the Full size image in new tab. The problem is that Google is indexing the Thumbnail photos only, and leaves the Large images that it links to. I need the alt attribute text…

问题原文

原帖链接 · MEGA · CC BY-SA 3.0

I have a page full of thumbnails, when clicked it opens the Full size image in new tab.

The problem is that Google is indexing the Thumbnail photos only, and leaves the Large images that it links to.

I need the alt attribute text of the Thumbnail to lead to the Original image when searched in Google Images.

My code is below:

<div class="thumb">
  <a href="images/wallpaper.jpg">
    <img src="images/wallpaper-small.jpg" target="_blank" alt="wallpaper-description">
  </a>
</div>

And this is an illustration of how my page works:


What I am doing wrong? what can be done to index Large images and leave Thumbnails?

社区高分解答

原帖链接 · Simon Hayter · CC BY-SA 3.0

The issue is that Google only sees one ALT tag therefore the other image is without description and will not rank in image search results.

If using a lightbox then preferably you should code or use one that supports HTML5 data- e.g:*

<div class="thumb">
    <img src="example.jpg" data-src="example-thumbnail.jpg" alt="example">
</div>

If you are using only CSS and HTML then you COULD use one of 3 methods that I can think of:


Method 1: Scrap the thumbnails and resize the larger image down to thumb size:

<!-- HTML -->
<div class="thumbnail">
    <img src="example.jpg" alt="example">
</div>

/* CSS */
.thumbnail img {
    max-width: 200px;
}
.thumbnail img:hover {
    max-width: 100%;
}

You could even spice this up by using a Pure CSS lightbox


Method 2: Link to a valid page rather than a image:

<!-- Embedded Small -->
<a href="/path/to/example.html" title="View Image Full Size">
    <img src="example.jpg" alt="thumbnail of example">
</a>

Method 3: Show and Hide:

<!-- Both Images -->
<div class="thumbnail">
    <img src="example.jpg" alt="example">
    <img src="example-thumbnail.jpg" alt="example thumbnail">
</div>

/* CSS */
.thumbnail img:first-child {
    max-width: 200px;
}
.thumbnail img:last-child {
    max-width: 100%;
    display: none;
}
.thumbnail:hover img:first-child {
    display: none;
}
.thumbnail:hover img:last-child {
    display: block;
}

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-12-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。