May 02, 2021 HTML
HTML header elements contain a profile of the document, also known as meta-information.
The title of the HTML document is defined
Define the title of the HTML document using the hashtag
The URL of all links is defined
Define the default link destination address for all links on the page, using slt;base.
The meta tag of the HTML document is provided
Use the elements to describe the description, keywords, authors, character sets, etc. of the HTML document.
The element contains all the head label elements. You can insert scripts, style files (CSS), and various meta-information in the element.
Elements that can be added to the head area can be labeled as: slt;title>, slt;style>, slt;meta-gt;, slt;script>, slt;noscript> and slt;base>.
The element describes the various properties and information of the document, including the title of the document, its location on the Web, and its relationship to other documents.
The label defines the titles of different documents.
Title is required in HTML/XHTML documents.
Title element:
A simple HTML document:
<!DOCTYPE html>
<html>
<head>
<title>编程狮(w3cschool.cn)</title>
</head>
<body>
W3cschool is ready to program anytime, anywhere!
</body>
</html>
The label describes the basic link address/link destination, which as all links in the HTML document specifies the default address or target:
<head>
<base href="//www.w3cschool.cn/images/" target="_blank">
</head>
Tip: In HTML, the label does not end the label, and in XHTML, the label must be turned off correctly.
The label defines the relationship between the document and external resources.
Labels are typically used to link to style sheets:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
The label defines the style file reference address of the HTML document.
In the element, you need to specify a style file to render the HTML document:
<head>
<style type="text/css">
body {background-color:yellow}
p {color:blue}
</style>
</head>
Metadata is information about data.
The label provides metadata about the HTML document. Metadata is not displayed on the page, but is readable for the machine.
Typically, the meta element is used to specify the description of the page, keywords, author of the document, last modified time, and other metadata.
The label is always in the head element.
Metadata can be used for browsers (how to display content or reload pages), search engines (keywords), or other Web services.
Some search engines use the name and content properties of meta elements to index your pages.
The following meta element defines the description of the page:
<meta name="description" content="Free Web tutorials on HTML, CSS, XML" />
The following meta element defines the key words of the page:
<meta name="keywords" content="HTML, CSS, XML" />
The name and content properties are used to describe the content of the page.
The label is used to load script files such as JavaScript.
The elements are described in more detail in the following sections.
Label | Describe |
---|---|
<head> | The information for the document is defined |
<title> | The title of the document is defined |
<base> | The default link address for the page link label is defined |
<link> | Defines the relationship between a document and an external resource |
<meta> | Metadata in HTML documents is defined |
<script> | The script file for the client is defined |
<style> | A style file that defines an HTML document |