为什么可以在头部部分添加文本

Why is it possible to add text inside the head section

为什么 HTML 页面的 head 部分中的文本在 DOM 中呈现?

根据 MDN 头部部分应执行以下操作:

The HTML element provides general information (metadata) about the document, including its title and links to its scripts and style sheets.

如果您在页面的标头部分放置一些文本,它将放置在呈现网页的 body 部分。这不是奇怪的行为吗?

文本在 head 标签中无效。

浏览器的错误更正将文本从 head 移动到 body

4.2.1 The head element

Content model:
If the document is an iframe srcdoc document or if title information is available from a higher-level protocol: Zero or more elements of metadata content, of which no more than one is a title element and no more than one is a base element.
Otherwise: One or more elements of metadata content, of which exactly one is a title element and no more than one is a base element.