我有一段这样的代码:
<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>
除了title
元素之外,我是否还需要指定figcaption
属性,否则会导致SEO问题?
答案 0 :(得分:3)
标题属性主要用于提供有关该图像或链接的工具提示。通常是目标的标题。
在图像中,使用figcaption应该足以克服title属性,因此您有一个特定的标记来描述资源。如果总是使用ALT属性,即使使用figcaption也是如此。
这是因为图中可以有多个图像。
例如,使用3张图片来说明流程的进度。
<figure>
<img src="img1.png" alt="The start of process. Subject is raw." />
<img src="img2.png" alt="Middle process. Subject is changing." />
<img src="img3.png" alt="End of process. Subject is completely transformed." />
<figcaption>Process steps, from left to right: raw subject, changing and changed subject.</figcaption>
</figure>
答案 1 :(得分:0)
Figcaption就足够了。但是如果你必须应用像vCard这样的微格式,你可能需要指定标题: http://www.rachaelmoore.name/web-design/microformats/marking-up-contact-information-semantic-using-html5-microformat/