<head>
概述
HTML head 元素 规定文档相关的配置信息(元数据),包括文档的标题,引用的文档样式和脚本等。
- 内容类别 无
- 允许内容至少包含一个
<title>
元素来指定文档的标题信息,除非标题已经从更高等级协议中指定(<iframe>
)。 - 允许父元素
<html>
元素 - DOM 接口
HTMLHeadElement
属性
示例
<html>
<head>
<title>文档标题</title>
</head>
</html>
附注
如果在文档中忽略了 <head>
标签,则大部分浏览器会自动创建一个 <head>
元素。当然,有一些不会。
下面这些浏览器经测试不会自动创建一个 head 元素:Android <=1.6, iPhone <=3.1.3, Nokia 90, Opera <=9.27, and Safari <=3.2.1。
规范
Specification | Status | Comment |
---|---|---|
HTML Living Standard <head> |
Living Standard | 自上一次快照后未改变 |
HTML5 <head> |
Recommendation | 废弃 profile |
HTML 4.01 Specification <head> |
Recommendation |
浏览器兼容性
BCD tables only load in the browser