HTML <head>
View online examples
<title> - Defines the title of different documents
Use <title> tag to define the title of HTML documents
<base> - Defines the URL of all links
Use <base> to define the default link target address of all links in the page.
<meta> - Provides HTML document meta tags
Use <meta> tag to describe the description, keywords, author, character set, etc. of HTML documents.
HTML <head> element
<head> element contains all the head tags elements. In <head> element, you can insert scripts (scripts), style files (CSS), and various meta information.
Elements that can be added to the head area include: <title>, <style>, <meta>, <link>, <script>, <noscript>, and <base>.
HTML <title> element
<title> tag defines the title of different documents.
<title> is necessary in HTML/XHTML documents.
<title> element:
- Defines the title of the browser toolbar
- When the webpage is added to the bookmarks, it displays the title in the bookmarks.
- Displays the title in the search engine result page.
A simple HTML document:
Example
HTML <base> element
<base> tag describes the basic link address/destination of the page, which is used as the default link address for all link tags in the HTML document.
Example
HTML <link> element
<link> tag defines the relationship between the document and external resources.
<link> tag is usually used to link to style sheets:
Example
HTML <style> element
<style> tag defines the reference address of the HTML document's style file.
You can also directly add styles to render the HTML document in the <style> element:
Example
HTML <meta> element
<meta> tag describes some basic metadata.
<meta> tag provides metadata. Metadata is not displayed on the page, but is parsed by the browser.
<meta> tag is usually used to specify the description, keywords, file last modification time, author, and other metadata.
Metadata can be used for the browser (how to display the content or reload the page), search engines (keywords), or other Web services.
<meta> tag is usually placed in the <head> area.
<meta> tag - Example
Define keywords for search engines:
<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
Define content for the article:
<meta name="description" content="免费 Web & 编程 教程">
Define author for the article:
<meta name="author" content="Example">
Refresh the current page every 30 seconds:
<meta http-equiv="refresh" content="30">
HTML <script> element
<script> tag is used to load script files, such as JavaScript.
<script> element will be detailed in the following chapters.
HTML <head> element
| Tag | Description |
|---|---|
| <head> | Defines the information of the document |
| <title> | Defines the title of the document |
| <base> | Defines the default link address of the page link tags |
| <link> | Defines a relationship between the document and external resources |
| <meta> | Defines metadata in HTML document |
| <script> | Defines client-side script files |
| <style> | Defines HTML document style files |