HTML <head>
HTML <head>
element
<head>
element contains all the header tag elements. In <head>
can insert scripts (scripts), style files (CSS), and various meta messages into the element.
The element labels that can be added to the header area are:<script>
, <noscript>
and <base>
HTML <title>
element
<title>
tags define the titles of different documents.
<title>
is required in HTML/XHTML documents.
<title>
elements:
Defines the title of the browser toolbar
The title displayed in the favorites when the web page is added to the favorites
The title displayed on the search engine results page
A simple HTML document:
Example
<!DOCTYPEhtml><html><head><metacharset="utf-8"><title>document title</title></head><body>document content......</body></html>
HTML < base > element
The <base>
tag describes the basic link address / link destination and serves as the default link for all link tags in the HTML document:
<head>
<base href="http://www.runoob.com/images/" target="_blank">
</head>
HTML < link > element
<link>
tags define the relationship between the document and external resources.
<link>
tags are typically used to link to style sheets:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
HTML <style>
element
<style>
tag defines the style file reference address of the HTML document.
In <style>
can also add styles directly to the element to render the HTML document:
<head>
<style type="text/css">
body {background-color:yellow}
p {color:blue}
</style>
</head>
HTML < meta > element
The meta tag describes some basic metadata.
<meta>
tag provides metadata. The metadata is not displayed on the page, but it will be parsed by the browser.
The META element is often used to specify the description of the web page, keywords, last modification time of the file, author, and other metadata.
Metadata can be used in browsers (how to display content or reload pages), search engines (keywords), or other Web services.
<meta>
is generally placed in <head>
region
<meta>
label-use instance
Define keywords for search engines:
<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
Define the description for the web page:
<meta name="description" content="Free Web&Programming Tutorial">
Define the author of the page:
<meta name="author" content="Runoob">
Refresh the current page every 30 seconds:
<meta http-equiv="refresh" content="30">
HTML <script>
element
<script>
tags are used to load script files, such as JavaScript.
<script>
elements are described in detail in later chapters.
HTML head element
Label |
Description |
---|---|
< head > |
Defines the information of the document |
< title > |
Defines the title of the document |
< base > |
Defines the default link address for the page link label |
< link > |
Defines the relationship between a document and external resources |
< meta > |
Defines the metadata in the HTML document |
< script > |
Defines the script file for the client |
< style > |
Defines the style file for the HTML document |