html 5.1 允许您在其他 header 中嵌套 (header)和 (footer)。 如果页眉或页脚本身包含在 section 内容中,则可以向 header 元素添加页眉或页脚。
如果你想在诸如 <section> 和 <article> 等语义分段元素中添加精心设计的 header,这个特性是非常有用的。
在下面给出的代码中,<article> 包含 <header>,其具有本身包含 <header> 标签的 <aside> 标签。
- <article>
- <header>
- <h2>
- Lesson: How to cook chicken
- </h2>
- <aside>
- <header>
- <h2>
- About the author: Tom Hank
- </h2>
- <p>
- <a href="./tomhank/">
- Contact him!
- </a>
- </p>
- </header>
- <p>
- Expert in nothing but Cooking. The cookbook sideshow.
- </p>
- </aside>
- </header>
- <p>
- <ins>
- Pour the marinade into the zip-top bag with the chicken and seal it. Remove
- as much air as possible from the bag and seal it.
- </ins>
- </p>
- </article>
来源: