在 <article> 中,<figure> 语义上可以放在 <header> 中吗?
In an <article>, can <figure> semantically be put inside <header>?
假设我有这个,
<article>
<header>
<h1>Article title</h1>
<p>Article kicker</p>
<figure>
<img class="featured-image" src="http://article.com/featured/image.jpg">
</figure>
</header>
<div class="content">
<p>Bla bla</p>
<p>Bla bla</p>
</div>
<footer>
<p>About author</p>
</footer>
</article>
将 <figure>
放在 <header>
中在语义上是否正确?
规范将 <figure>
定义为,
a unit of content, optionally with a caption, that is self-contained,
that is typically referenced as a single unit from the main flow of
the document
如果把它放在<header>
里面,会不会让<figure>
属于<article>
的头部,而不是属于<article>
本身?试着环顾四周,但我还没有找到答案。
该图仍将是文章的一部分。它恰好在文章 header 中,如果您的图实际上是文章 header 的一部分而不是文章的主要内容,那很好。
如果您问的是分段,<header>
和 <footer>
不是分段元素,因此该图仍将是文章大纲的一部分。也就是说,删除或注释掉 <header>
和 <footer>
标签:
<article>
<!-- header -->
<h1>Article title</h1>
<p>Article kicker</p>
<figure>
<img class="featured-image" src="http://article.com/featured/image.jpg">
</figure>
<!-- /header -->
<div class="content">
<p>Bla bla</p>
<p>Bla bla</p>
</div>
<!-- footer -->
<p>About author</p>
<!-- /footer -->
</article>
结果相同。
假设我有这个,
<article>
<header>
<h1>Article title</h1>
<p>Article kicker</p>
<figure>
<img class="featured-image" src="http://article.com/featured/image.jpg">
</figure>
</header>
<div class="content">
<p>Bla bla</p>
<p>Bla bla</p>
</div>
<footer>
<p>About author</p>
</footer>
</article>
将 <figure>
放在 <header>
中在语义上是否正确?
规范将 <figure>
定义为,
a unit of content, optionally with a caption, that is self-contained, that is typically referenced as a single unit from the main flow of the document
如果把它放在<header>
里面,会不会让<figure>
属于<article>
的头部,而不是属于<article>
本身?试着环顾四周,但我还没有找到答案。
该图仍将是文章的一部分。它恰好在文章 header 中,如果您的图实际上是文章 header 的一部分而不是文章的主要内容,那很好。
如果您问的是分段,<header>
和 <footer>
不是分段元素,因此该图仍将是文章大纲的一部分。也就是说,删除或注释掉 <header>
和 <footer>
标签:
<article>
<!-- header -->
<h1>Article title</h1>
<p>Article kicker</p>
<figure>
<img class="featured-image" src="http://article.com/featured/image.jpg">
</figure>
<!-- /header -->
<div class="content">
<p>Bla bla</p>
<p>Bla bla</p>
</div>
<!-- footer -->
<p>About author</p>
<!-- /footer -->
</article>
结果相同。