English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The <head> element is the container for all header elements. Elements within <head> can include scripts, indicate where the browser can find style sheets, provide meta information, etc.
<title> - Define the title of the HTML document
Use the <title> tag to define the title of the HTML document
<base> - Define the URL of all links
Use <base> to define the default link target address for all links on the page.
<meta> -
Provide the meta tags of the HTML document
Use the <meta> element to describe the description, keywords, author, character set, etc. of the HTML document.
The <head> element contains all the header tag elements. In You can insert scripts (scripts), style sheets (CSS), and various meta information in the <head> element.
The elements that can be added in the header area are: <title>, <style>, <meta>, <link>, <script>, <noscript>, and <base>.
The <title> tag defines the title of different documents.
The <title> in HTML/Is required in an XHTML document.
The <title> element:
Define the title displayed in the browser toolbar
Title displayed in the favorites when the web page is added to the favorites
Title displayed on the search engine results page
A simple HTML document:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Title of the HTML document</title> </head> <body> The content of the HTML document...... </body> </html>Test and see ‹/›
The <base> tag describes the basic link address/Link target, this tag is used as the default link for all link tags in the HTML document:
<head> <base href="https://www.oldtoolbag.com/images/" target="_blank"> </head>
The <link> tag defines the relationship between the document and external resources.
The <link> tag is usually used to link to style sheets:
<head> <link rel="stylesheet" type="/css" href="style.css"> </head>
The <style> tag defines the style sheet reference address of the HTML document.
You can also directly add styles in the <style> element to render the HTML document:
<head> <style type="text/css"> /*Define the background color of the web page*/ body {background-color:red} p {color:green} </style> </head>
The meta tag describes some basic metadata.
<meta> tags provide metadata. Metadata is not displayed on the page, but it will be parsed by the browser.
META elements are usually used to specify the description, keywords, the last modification time of the file, author, and other metadata of the web page.
Metadata can be used by browsers (how to display content or reload the page), search engines (keywords), or other Web services.
<meta> is usually placed in the <head> area.
Define keywords (keywords) for search engines:
<meta name="keywords" content="HTML, CSS, XML, XHTML, JS, PHP">
Define the description content (description) for the web page:
<meta name="description" content="Free online basic tutorial">
Define mobile and PC adaptive for the web page (viewport):
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
Defined the web page author (author):
<meta name="author" content="w3codebox">
Every10seconds refresh the current page (Refresh):
<meta http-equiv="refresh" content="10">
<script> tag is used to load script files, such as: JavaScript.
<script> element will be described in detail in the following chapters.
Tag | Description |
<head> | Defined the information of the document |
<title> | Defined the title of the document |
<base> | Defined the default link address of the page link tag |
<link> | Defined the relationship between a document and external resources |
<meta> | Metadata within the HTML document |
<script> | Script file that defines the client-side script |
<style> | Stylesheet that defines the style of the HTML document |