文章标签和 img

Nrc*_*Nrc 2 html article semantics

我了解文章标签是“内容的独立项目部分” www.w3.org/wiki/HTML/Elements/article

我有一个页面,只有一篇博客文章。该博客在文本顶部有一个 img 和一个标题(它是一个 img,用于说明我在博客文本中所说的内容)。img 和标题应该在文章标签的内部还是外部?

图像:

<img src="1.png">
<div>Caption of the image</div>
Run Code Online (Sandbox Code Playgroud)

博客文章简化了:

<article>
<h1>Title of the post</h1>
<div>Last Updated: 2016-01-07</div>
<div>       
    <p>This is the body of the post</p>
</div>
<p>Author of the post</p>
</article>
Run Code Online (Sandbox Code Playgroud)

raf*_*ten 5

您可能需要同时检查figurefigcaption标签。

文档中的示例:

<figure>
  <img src="https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png" alt="An awesome picture">  
  <figcaption>Fig1. MDN Logo</figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)

如果 与figure相关article,那么我会将它放在article标签中。