Eri*_*ric 4 html5 semantic-markup semantics
我有点疑惑,我应该如何使用HTML5 <header>,<section>和<footer>标签.目前,我无法确定是否像这样使用它们:
<section id="example_section">
<header>
<h1>Example Section</h1>
<p>etc</p>
</header>
<p>Content para 1</p>
<p>Content para 2</p>
<p>Content para 3</p>
<footer>
Wasn't that swell?
</footer>
</section>
Run Code Online (Sandbox Code Playgroud)
或者像这样:
<header>
<h1>Example Section</h1>
<p>etc</p>
</header>
<section id="example_section">
<p>Content para 1</p>
<p>Content para 2</p>
<p>Content para 3</p>
</section>
<footer>
Wasn't that swell?
</footer>
Run Code Online (Sandbox Code Playgroud)
或妥协,像这样:
<section id="example_section_wrapper">
<header>
<h1>Example Section</h1>
<p>etc</p>
</header>
<section id="example_section">
<p>Content para 1</p>
<p>Content para 2</p>
<p>Content para 3</p>
</section>
<footer>
Wasn't that swell?
</footer>
</section>
Run Code Online (Sandbox Code Playgroud)
我已经包含了ID以显示这些部分的预期含义.我意识到他们是不必要的.哪种方法正确?
一切都是正确的,但这比其他任何一个都好
<section id="example_section_wrapper">
<header>
<h1>Example Section</h1>
<p>etc</p>
</header>
<section id="example_section">
<p>Content para 1</p>
<p>Content para 2</p>
<p>Content para 3</p>
</section>
<footer>
Wasn't that swell?
</footer>
</section>
Run Code Online (Sandbox Code Playgroud)
几个最佳实践和tuts链接
| 归档时间: |
|
| 查看次数: |
2233 次 |
| 最近记录: |