HTML5:一个部分中的多个页脚/标题 [英] HTML5: Multiple footers/headers in a section

查看:144
本文介绍了HTML5:一个部分中的多个页脚/标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,您可以在页面中设置多个页眉/页脚,例如< article> s以及<$ c $的另一个网站页眉/页脚c>< body> 但是我没有发现任何地方声明在一个部分中有多个页眉和/或页脚是可以接受的。

I understand you can have multiple headers/footers in a page such as for the <article>s and another site wide header/footer for the <body> but I've not found anywhere stating that having multiple headers and or footers in a single section is acceptable.

<body>
<header class="header-group-1"></header>
<header class="header-group-2"></header>

<!-- other content -->

<footer class="footer-group-1></footer>
<footer class="footer-group-2></footer>
</body>


推荐答案

多个 header 元素,每个元素都指定其最近的祖先切片内容或切片根元素的介绍内容,即最近的封闭文章,旁边,导航,部分,块引用,正文,细节,对话框,字段集,图形或td元素。所以你可以拥有例如。

Multiple header elements are allowed, and each of them specifies "introductory content for its nearest ancestor sectioning content or sectioning root element", i.e. the nearest enclosing article, aside, nav, section, blockquote, body, details, dialog, fieldset, figure, or td element. So you can have e.g.

<body>
<header>body header</header>
...
<article>
  <header>article header</header>
  ...
</article>

没有禁止例如文章元素中的两个标题元素(处于相同的嵌套级别)。然后他们都会包含介绍性内容。然而,很难想象这是有意义的情况,因为 header 元素通常在其他内容之前,而标题因此是相邻的,可以合并为一个。

There is no prohibition against having e.g. two header elements (at the same level of nesting) in an article element. They would then both contain "introductory content" for it. It is however difficult to imagine situations where this would make sense, since header elements normally precede other content, and the header would thus be adjacent and could be combined into one.

这篇关于HTML5:一个部分中的多个页脚/标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆