In HTML5, can the lt;headergt; and lt;footergt; tags appear outside of the lt;bodygt; tag?(在 HTML5 中,lt;headergt;和lt;页脚gt;标签出现在 lt;bodygt; 之外.标签?)
问题描述
我目前是这样使用上面的标签的(经典的标签顺序):
I'm currently using the above tags in this way (classic tag order):
<html>
<head>...</head>
<body>
<header>...</header>
<section>...</section>
<footer>...</footer>
</body>
</html>
标签的使用和规范在以前的 HTML (4.x) 版本中非常严格,而 HTML5 并不真正需要 <head>
甚至 <body>代码>标签.
Tag usage and specifications were very rigid in previous versions of HTML (4.x), while HTML5 doesn't really need <head>
and even <body>
tags.
所以我会使用以下结构,恕我直言,它比前一个更语义化.
So I would use the following structure, which IMHO is much more semantic than the previous one.
<html>
<header>...</header> <!-- put header and footer outside the body tag -->
<body>
<section>...</section>
<section>...</section>
<section>...</section>
</body>
<footer>...</footer>
</html>
你怎么看?
推荐答案
嗯,<head>
标签与<header>
标签无关.head
中包含所有元数据和内容,而 header
只是一个布局组件.
布局进入body
.所以我不同意你的观点.
Well, the <head>
tag has nothing to do with the <header>
tag. In the head
comes all the metadata and stuff, while the header
is just a layout component.
And layout comes into body
. So I disagree with you.
这篇关于在 HTML5 中,<header>和<页脚>标签出现在 <body> 之外.标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 HTML5 中,<header>和<页脚>标签出现在 <body> 之外.标签?


基础教程推荐
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01