小编And*_*awa的帖子

如何在HTML5中正确使用"section"标签?

我正在尝试在HTML5中构建一个布局,在阅读了几篇不同的文章后,我感到很困惑.我正试图获得一些如何使用它的输入.

以下是我要来回的变化:

1)

<section id="content">
      <h1>Heading</h1>
      <div id="primary">
         Some text goes here...
      </div>
   </section>
Run Code Online (Sandbox Code Playgroud)

你能使用section标签充当容器吗?

2)

 <div id="content">
      <h1>Heading</h1>
      <section id="primary">
         <article>
            <h2>Post Title</h2>
            <p>Some text goes here...</p>
         </article>
      </section>
      <section id="primary">
         <article>
            <h2>Post Title</h2>
            <p>Some text goes here...</p>
         </article>
      </section>
   </div>
Run Code Online (Sandbox Code Playgroud)

使用<section>标签的正确方法是什么?

html5

101
推荐指数
2
解决办法
10万
查看次数

标签 统计

html5 ×1