如果我的元素有< figcaption>`,我还需要使用title属性吗? [英] Do I still need to use the title attribute if my element has a `<figcaption>`?
问题描述
我有这样一段代码:
< figure>
< figcaption>一个令人惊叹的图片,我忘了指定< / figcaption>的网址
< / figure>
是否需要指定标题
属性除了 figcaption
元素,并且不会这样做会导致SEO问题? 解决方案Title属性主要用于提供关于该图像或链接的工具提示。通常是目标的标题。
在图像中,使用figcaption应该足以克服title属性,因此您有一个用于描述资源的特定标记。无论如何,我们总是会考虑使用ALT属性,即使是figcaption也是如此。
这是因为您可以在一个图中有多个图片。
例如,使用3张图像来表示流程进度。
< figure>
< figcaption>处理步骤,从左到右:原始主题,更改和更改主题。< / figcaption>
< / figure>
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?
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.
<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>`,我还需要使用title属性吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!