HTML head tag


The <head> tag defines the headers of the document.

The element information within the <head> element is provided to the browser as auxiliary information and will not be displayed in the browser window. Only the title information within the <title> tag will appear in the title bar at the top of the browser.

<head>
  other sub tags
</head>

Head sub tag

The <head> tag is actually composed of a number of sub-tags. Valid sub-tags include:

subtags Description
<meta> Provides meta-information about the page
<link> Defines the relationship of the document to external resources, such as CSS style documents
<style> Defines CSS style information for HTML documents
<title>> Define the title of the XHTML document
<base> Specifies the default address or default destination for all links on the page, not commonly used

In addition to the above sub-tags, <head> tags are not allowed to embed other labels, such as the following usage is wrong:

<head>
  <p>Contents</p>
</head>

The embedded paragraph text in this example, although it can be displayed by most browsers, is only a fault-tolerant mechanism for browsers. As a standard HTML language, it should be avoided.


Complete example
<head>
   <link rel="icon" href="./favicon.ico" type="image/x-icon" />
   <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <meta http-equiv="content-language" content="en" />
   <meta name="robots" content="all" />
   <meta name="keywords" content="html, css, javascript" />
   <meta name="description" content="Developer programming tutorial" />
   <meta name="copyright" content="Copyright (c) 2010 by www.developertut.com" />
   <meta name="author" content="developertut.com" />
   <link href="style/default.css" rel="stylesheet" type="text/css" />
   <title>Developer Tutorial</title>
   <script>
   	//JavaScript code
   </script>
  </head>



Copyright 2014-2017 by DeveloperTut.com. All Rights Reserved.
TwitterGoogle+Facebook