我读了这个问题:Do I still need to use the title attribute if my element has a `<figcaption>`?HTML5中的<figure>标签中使用哪个标题?
但是我的回答是面向img
标签,但是,如果我有以下figure
,没有img
,但有table
:
<figure title="The table of life">
<table>
<caption>The table of life</caption>
<tbody>...</tbody>
</table>
<figcaption>The table of life<figcaption>
</figure>
在这里,我有3个给出标题的方法有:<caption>
标记(仅用于table
),<figcaption>
标记(仅用于figure
)和title
属性(通用)。
哪一个更好用?
这里是figure
一个例子,而不table
:
<figure title="Description of my char in RPG">
<h1>Seninha</h1>
<p>Seninha was born in the moon in the year of 13...<p>
<dl>
<dt>HP</dt><dd>15</dd>
<dt>MP</dt><dd>18</dd>
<dt>IQ</dt><dd>99999</dd>
<dt>ST</dt><dd>-10</dd>
</dl>
<figcaption>Description of my char in RPG<figcaption>
</figure>
因此,在一块内容(表格,img,段落等)中使用标题的最佳方式是figcaption? 我的意图是在我的个人网站上使用“figure + figcaption”或“title”属性显示段落或一组段落的评论。我用'title'这里是结果(在葡萄牙语中)http://seninha.net 我可以用'figcaption'来做,但标记会正确吗? – Seninha
@Seninha:你为什么首先使用'figure'?看起来你的例子中不需要它。无论如何,使用'title'属性不是提供'figure'标题的好选择,除非这个标题对于理解内容并不重要。 – unor