我讀了這個問題: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