What's in the <head> tag? Metadata-Metadata in HTML

What are HTML head elements?

The HTML  <head> element is <body> different from the  element. Its content will not be displayed in the browser. Its function is to save some metadata of the page  .

The head of a large page will contain a lot of metadata. You can use the   developer tools to  view the head information of the web page.

Add title

As mentioned before  <title>, it can add a title to a document. Don't  <h1> confuse it with the element, it <h1> 's to add a title to the body. Sometimes  <h1> called the title of the page. But the two are not the same.

  • <h1> The element is displayed on the page when the page is loaded, usually only once, and is used to mark the title of the page content (story name, news summary, etc.).
  • <title> An element is a piece of metadata that represents the title of the entire HTML document (not the content of the document).

Elements  <title> are also used in other ways. For example, if you try to bookmark a page (click the star at the end of the address bar in Firefox), <title> the content you will see  is signed as a suggested book.

<title> The content of the element  is also used in the search results.

Metadata: <meta> element

Metadata is data that describes data, and HTML has an "official" way to add metadata to a document-   <meta> elements. Of course, other things mentioned in this article can also be treated as metadata. There are many different kinds of  <meta> elements that can be included in the <head> element of your page, but now we will not try to explain all the types, this will only cause confusion. We will explain some of the types you often see, let you have an idea first.

Specify the encoding of characters in your document

<meta charset="utf-8">

This element simply specifies the character encoding of the document-the character set that is allowed to be used in this document. utf-8 Is a universal character set, it contains most of the characters in any human language.

Many <meta> elements contain name and  content features:

  • name Specifies the type of meta element; explain what type of information the element contains.
  • content The actual metadata content is specified.

 

 

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/maimang1001/article/details/114281355