TITLE属性应该在图片上还是父链接上? [英] Should the TITLE attribute be on images or parent links for SEO?

查看:191
本文介绍了TITLE属性应该在图片上还是父链接上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当涉及到链接的图片和SEO时,< img> 应该使用 title 标记,父母< a> 标记或两者兼而有之?



常见做法似乎是添加 title 属性添加到< a> 标记。但这是最适合搜索引擎优化吗?添加到两个标签会有什么伤害吗?如果不是,那么标题文本在两个方面是否都是相同的?

P.S。我知道你应该几乎总是在< img> 标签上使用 alt 属性,而不管 title 属性。

解决方案

w3schools定义title属性如下:


title属性指定了有关元素的额外信息。
当鼠标移到元素上时,信息最常显示为工具提示文本。


至于语义标记,它是足以将标题属性添加到 a 标记中。将它添加到图像中并不是必需的,除非您希望title属性具有不同的内容来直接描述图像。

就SEO而言:如果 img 标签已经有 alt 属性,你不需要title属性。

一个有用的blogentry:

http://www.wpromote.com/blog/seo/image-alt-vs-title-using- alt-title-attributes-in-image-tags /

摘要:


当图像不能显示
时,ALT属性提供了替代文本,TITLE文本提供了有关
的补充信息,它是包含它的元素。根据
Google网站管理员博客上的这篇文章, Google倾向于关注ALT文本中的信息。所以你有它!如果你只打算使用一个属性... ALT就是



When it comes to linked images and SEO, should the title attribute be used on the <img> tag, the parent <a> tag or both?

Common practice seems to be to add the title attribute to the <a> tag. But is this best for SEO? Would there be any harm in adding it to both tags? If not, is there harm in the title text being identical on both?

P.S. I am aware that you should almost always use the alt attribute on <img> tags regardless of the title attribute.

解决方案

w3schools defines the title attribute as follows:

The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element.

As for semantic markup it's enough to add the title attribute to the a tag. Adding it to the image within isn't necessary, except you want to have different content for the title attribute to describe directly the image.

As far as SEO is concerned: if the img tag already has the alt attribute, you don't need the title attribute.

A Usefull blogentry about that:
http://www.wpromote.com/blog/seo/image-alt-vs-title-using-alt-title-attributes-in-image-tags/

Excerpt:

While the ALT attribute provides alternative text when images cannot be displayed, the TITLE text offers supplementary information about the element in which it is contained. According to this post on the Google Webmaster Blog, Google tends to focus on the information in the ALT text. So there you have it! If you’re only going to use one attribute… ALT it is!

这篇关于TITLE属性应该在图片上还是父链接上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆