【发布时间】:2017-11-18 01:34:47
【问题描述】:
将figcaption 元素置于figure 元素内的任何位置在语义/语法上是否正确?
考虑以下几点:
<figure>
<figcaption>Hello caption</figcaption>
<img src="/path/to/file">
</figure>
【问题讨论】:
标签: html semantic-markup
将figcaption 元素置于figure 元素内的任何位置在语义/语法上是否正确?
考虑以下几点:
<figure>
<figcaption>Hello caption</figcaption>
<img src="/path/to/file">
</figure>
【问题讨论】:
标签: html semantic-markup
tl;博士:
figcaption 可以放置在 figure 中的任何位置(作为孩子,而不是后代)figcaption 可以作为figure 的第一个或最后一个孩子放置
In HTML5,figcaption 元素必须是figure 的第一个或最后一个子元素:
任一:一个
figcaption元素,后跟流内容。
或者:流内容后跟一个figcaption元素。
或者:流内容。
In HTML 5.1,figcaption元素可以放在figure元素的任意位置:
流内容可选地包括
figcaption子元素。
In HTML 5.2 (Proposed REC) 也是。
关于更改的问题如下:
Allow figcaption anywhere in a figure element?
In the HTML Living Standard(截至 2017-11-17),与 HTML5 相同:
任一:一个
figcaption元素,后跟流内容。
或者:流内容后跟一个figcaption元素。
或者:流内容。
【讨论】: