3 Head Data of an HTML DocumentHTML文档的头部数据
The head data between <head>
and </head>
contains important information and data about an HTML document that’s used by web browsers or search engines. <head>
和</head>
之间的head数据包含有关web浏览器或搜索引擎使用的HTML文档的重要信息和数据。In this chapter, you’ll get to know the HTML elements for the head data of an HTML document in more detail.在本章中,您将更详细地了解HTML文档头部数据的HTML元素。
In the head of the HTML document between 在<head>
and </head>
, you can insert various HTML elements that enable you to control the content and the display of a web page. <head>
和</head>
之间的HTML文档头部,您可以插入各种HTML元素,使您能够控制网页的内容和显示。You can also establish the relationships between the web browser and other pages or documents here. 您还可以在此处建立web浏览器与其他页面或文档之间的关系。The content you write in the 除了head
element doesn’t get displayed by the web browser, except for the title
element. title
元素外,您在head
元素中写的内容不会被web浏览器显示。An overview of the different HTML elements, which you can write in the head section between 您可以在<head>
and </head>
, is followed by the description of the individual HTML elements.<head>
和</head>
之间的头部部分编写不同HTML元素的概述,然后是对单个HTML元素的描述。
This chapter may not be spectacular and exciting, but even the nonvisible parts in the head of an HTML document are part of the essential basics of HTML. 本章可能并不壮观和令人兴奋,但即使是HTML文档头部不可见的部分也是HTML基本知识的一部分。If you’re in a rush, I recommend that you at least take a look at the sections on the 如果你赶时间,我建议你至少看看关于<meta>
elements (Section 3.8.1, specifically the character encoding) and <title>
(Section 3.2). <meta>
元素(第3.8.1节,特别是字符编码)和<title>
(第3.2节)的部分。For the time being, these two headers are the most important elements for the next chapters. For all other HTML elements for head data, you can always look them up here if needed.目前,这两个标题是下一章最重要的元素。对于头部数据的所有其他HTML元素,如果需要,您可以随时在此处查找。
3.1 Overview of HTML Elements for the Head头部HTML元素概述
You must write the 您必须在打开head
element with the head data of an HTML document directly after the opening <html>
tag and before the document body with the body
element. <HTML>
标签之后,在带有body
元素的文档正文之前,直接用HTML文档的头部数据写入head
元素。You can use the elements from Table 3.1 or Figure 3.1 between 您可以在<head>
and </head>
(the order doesn’t matter). <head>
和</head>
之间使用表3.1或图3.1中的元素(顺序无关紧要)。Of the elements listed in Table 3.1, you must specify at least the 在表3.1中列出的元素中,您必须至少指定title
element.title
元素。
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Table 3.1
Elements That Can Be Used in the HTML Document Head between <head> and </head>可以在<Head>
和</Head>
之间的HTML文档头中使用的元素
Figure 3.1
In the Head Element between the <head> and </head> Tags, You Can Use the <title>, <base>, <link>, <style>, <script>, and <meta> Elements在<Head>
和</Head>
标签之间的Head元素中,您可以使用<title>
、<base>
、<link>
、<style>
、<script>
和<meta>
元素