<head> tag is one of
several important tags the developer places near the beginning of an
<head> tag is the part of the
document reserved for metadata, or information about the document
itself. Text typed here does not show up in the main browser window,
so styling the
<head> element is
not necessary. Instead it is most commonly used as a container for
You can think of tags within the
<head> as pointers to files
required to render and interact with the HTML document, and for the
exchange of other third party information about the document.
Examples of metadata include:
Metadata is fairly standardized and the number of elements developers
put within in their
depends on personal choice, or standards within an organization. It
isn't uncommon to see 15-30 of these informational elements kept in the
For non-interactive or static public content in informational websites, many webmasters use Content Management Systems (CMS), like WordPress. A CMS helps the user set up appropriate HTML tags including those specific to the knowledge graph method of indexing and pointers to helper applications.
Our focus here is for those seeking a deeper understanding of the HTML elements to add website interactivity.
<head> tag is optional in a
test HTML document but imperative in a production environment. In
fact, behind the scenes, modern browsers create a
<head> element on the fly if one
is not provided.
While a closing
<head> tag is not
required, it should be used. Also, the
<head> element must be the first
element within the
tag. So it typically starts at the third line of an HTML document.
It is also typical to see the
<title> tag as a required child
<head> tag. So the
minimum document that includes the
<head> tag will look like this.
As with all tags, Global Attributes can always be set.
Tags within the
may include as many as 8 elements. The Priority
column is provided as a starting point for beginners.
|High||The title of the document shows up in the browser tab and in query results on Search Engines.|
||Low||Sets the root directory for relative references within the HTML document structure.|
||High||References to internal documents for the rendering of the page, including stylesheets, fonts and images.|
||High||Examples of meta variables include those passed to search engines like description, keywords, author, and viewport.|
||Mid||Style sheets can be included inline, or within the
Normally, you only see the first two included once,
<base>. The rest may be used
Each user-agent (browser) has its own stylesheet per se. This dictates
how that browser styles each element by default. The Chrome browser
<head> element using
the following specifications.
The following code links an HTML file written in English to an internal
CSS file for document styling using the
<link> tag. Notice how this is a
one-line tag and is closed with the
at the end.
The page title and description fields show up in Search Engine results
so it is important for the webmaster to include them at a minimum for
every public-facing web page. The description is set up with a
A favicon is a square image that shows up in the browser on each open
tab. It is common to put this file in the root of the web server. This
offers another customization for organization branding. This is
accomplished with a
It is a good practice to specify the MIME type which is sent with data
transmissions across the Internet. At the same time communicating a
file's character set is helpful. This is accomplished in one line
<head> tag is paired
with other essential tags that should be included in every HTML
Our YouTube Channel is designed for smart people like you. Subscribe here.
<h1>, click Back.
<hr />tag. Click Next.