我有这样一段代码:如果我的元素有`<figcaption>`,我还需要使用title属性吗?
是否有必要对我来说,除了figcaption
元素指定title
属性,并没有这样做,导致搜索引擎优化的问题?
我有这样一段代码:如果我的元素有`<figcaption>`,我还需要使用title属性吗?
是否有必要对我来说,除了figcaption
元素指定title
属性,并没有这样做,导致搜索引擎优化的问题?
标题属性主要用于提供有关该图像或链接的工具提示。通常是目标的标题。
在图像中,使用figcaption应该足以克服title属性,因此您有用于描述资源的特定标记。无论如何,考虑到总是使用ALT属性,即使是无花果。
这是因为您可以在图中有多个图像。
例如,使用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>
Figcaption就足够了。但是,如果必须应用vCard等微格式,则可能需要指定标题: http://www.rachaelmoore.name/web-design/microformats/marking-up-contact-information-semantic-using-html5-microformat/