HTML head element

The HTML head element is an important part of a standard HTML web page. The standard head starts with the <head> tag and ends with the </head> tag. It is written at the very beginning of the HTML code of the web page, with the beginning <head> and the end</head> Between head> tags, you can place other important elements of the webpage, such as title , meta , link , script, style, base, etc., which are used to mark many basic information of the webpage. The browser will follow the <head></head > The information in the tag shows the appearance of the webpage designed by the designer. It should be noted that a webpage can only have one set of head tags, and only one set of head tags is required. If more than one set is more than one set, it may cause the browser Confused.

HTML head basic structure

<html>
<head>
 <title>Put the page title here</title>
 <meta name="keywords" content="web keyword 1, web keyword 2">
</head>
<body>here is the web content< /body>
</html>

The example provides a very basic HTML web page structure. The outermost layer is the <html> tag, followed by the head tag and the body tag from top to bottom. The web page is divided into two important parts, and then we put in the head area Two tags are entered, title and meta , where title is the title of the webpage, and meta has many functions. The use of name="keywords" means the keywords that match the webpage, that is, which keywords the designer wants the search engine to search for the webpage , But you can’t write randomly or too much, otherwise the search engine will exclude the page from the search results, which means it may not be searchable. There are many web page elements that can be used in the head area, just a little explanation.

Common elements in HTML head

elementDescription
titlePage title, each page can only have one title.
metaProvide search engines with important information about web pages.
linkIt is used to control the connection between web pages and external resources.
scriptUsed to use web scripts or embed external scripts, such as JavaScript or VBScript.
styleUsed to define the style used by the web page, such as css style.
baseUsed to formulate the goal of the URL in the web page.

Not all of the web elements in the HTML head area need to be used, but the title is a necessary item, otherwise the web page will not have a name.

Post a Comment

0 Comments