当链接是图片时如何指定链接文本?
我正在建立一个网上商店(我的第一个),我的客户想要在首页上显示他们当前的热门优惠的横幅。当然,我希望谷歌和其他机器人能够理解这些链接的全部内容。我认为(但我不确定)如果我的 标签中包含一些相关文本,Google 会更好地对待它。但横幅只是一个图像。我如何在那里放置文字?
可以工作吗?也许是
title=""
属性?
已添加:哦,忘了说 - 我将图像作为背景图像放置到我的 标签中 - 这使我可以垂直居中。所以没有
标签。
I'm making an web shop (my first one), and on the front page my client wants banners with their current hot deals. Naturally I want Google and other robots to be able to understand what these links are all about. I think (but I'm not sure) that Google will treat my <a>
tag better if it will have some relevant text inside it. But a banner is just an image. How do I put text there? Could a <span style="display:none">
work? Maybe the title=""
attribute?
Added: OOps, forgot to say - I place the image as a background image to my <a>
tag - this gives me vertical centering. So there are no <img>
tags.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Google 将为您的图像上的 Alt 文本属性建立索引。
http://www.search-marketing.info/organic-listings/img -alt.htm
Google will index the Alt text property on your image.
http://www.search-marketing.info/organic-listings/img-alt.htm
我一直都是
。我从 CSSZenGarden 学到了这个技巧。另一种“隐藏”文本的方法涉及设置
text-indent: -100000em;
,而且我确信还有更多方法。它在 CSS Zen Garden 中工作,谷歌不会惩罚它。搜索“ CSS 设计之美”,您会看到它已在 google 上建立索引。
I've always done
<a href="whatever.html"><span style="display:none;">My SEO text</span></a>
. I've learned this trick from the CSSZenGarden. Another way to "hide" text involve setting atext-indent: -100000em;
, and I'm sure there are some more.It works at the CSS Zen Garden, google does not penalize it. search for "the beauty of css design" and you'll see that it gets indexed at google.
Google 无法抓取图像,但 Google 可以索引替代文本,因此请尝试使用 alt-abbr 链接图像。
Google cant crawl images but Google can index alt text so try to link the images with alt-abbr.