如果我的元素有“”,我还需要使用 title 属性吗?
我有一段这样的代码:
<figure>
<img title="An amazing image that I forgot to specify a url for"/>
<figcaption>An amazing image that I forgot to specify a url for</figcaption>
</figure>
除了figcaption
元素之外,我是否还需要指定title
属性,这样做不会导致SEO问题吗?
I have a piece of code like this:
<figure>
<img title="An amazing image that I forgot to specify a url for"/>
<figcaption>An amazing image that I forgot to specify a url for</figcaption>
</figure>
Is it necessary for me to specify the title
attribute in addition to the figcaption
element, and will not doing so result in SEO problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
标题属性主要用于提供有关该图像或链接的内容的工具提示。通常是目标的头衔。
在图像中,使用Figcaption应该足以克服标题属性,因此您有一个特定的标记来描述资源。然而,请考虑始终使用 ALT 属性,即使使用Figcaption。
这是因为一张图中可以有多个图像。
例如,使用 3 个图像来说明流程的进度。
Title attribute is mainly for providing a tooltip about what is that image or link about. Usually a the target's title.
In the images, using figcaption should be enough to overcome title attribute, hence you have a specific markup for describing the resource. Howver consider always using ALT attribute, even with figcaption.
This is because you can have more than one image in a figure.
For example, using 3 images for ilustrating progress on a process.
有图说明就够了。但如果您必须应用 vCard 等微格式,则可能需要指定标题:
http://www.rachaelmoore.name/web-design/microformats/marking-up-contact-information-semantic-using-html5-microformat/" rachaelmoore.name/web-design/microformats/marking-up-contact-information-semantic-using-html5-microformat/
Figcaption is enough. But you may need to specify title if you have to apply microformats like vCard:
http://www.rachaelmoore.name/web-design/microformats/marking-up-contact-information-semantic-using-html5-microformat/