HTML head section
As with everything else, there is much more to a webpage than what you just see. Besides what you see on a webpage, also important is what is going on 'under the hood'.
This lesson focuses on:
- The <head> tag
- Tags inside the head section
- Putting innapropriate tags in the head section
The <head> tag
The <head> tag is what actually begins the head section of an HTML document. The head section of an HTML document contains several tags that specify important information about the webpage such as title, keywords and descriptions (for search engines), location of stylesheets, scripts, and more.
Example:
Tags inside the head section
There are several tags that go inside the head section of an HTML document.
The <base> tag
The <base> tag acts as a reference point for all the links on a page. This reference point is specified with the <base> tag's href attribute.
Example:
NOTE: The <base> tag does not have a closing tag.
Read more about the <base> tag in our HTML universal declarations page.
The <link> tag
The <link> tag defines a relationship between two douments. It is used to define the relationship between the document where it is located and another document.
A common use of the <link> tag is to call an external stylesheet.
Example:
NOTE: The <link> tag does not have a closing tag.
Read more about the <link> tag and stylesheets in our HTML stylesheets page.
The <meta> tag
The <meta> tag is one of the most important tags in HTML. The <meta> tag is used to describe the page in some way as well as other things such as refreshing a page automatically after a certain amount of time, and preventing webpages from being displayed in another websites frames page. Some of the things that can be described using the <meta> tag include the pages author, the software used to create the page, and a description of the content on the page.
Example:
NOTE: The <meta> tag does not have a closing tag.
Read more about the <meta> tag at our HTML meta tags page.
The <script> tag
The <script> tag is used to place scripts on a webpage. When using the <script> tag, you have to use its type attribute to specify the language the script is written in.
Example:
Read more about the <script> tag and using scripts at our at our HTML scripts page.
The <style> tag
The <style> tag is used to declare an internal stylesheet.
The <style> tag specifies the content type of a stylesheet with its type attribute which should be set to "text/css".
Example:
Read more about using the <style> tag and stylesheets at our HTML stylesheets page.
The <title> tag
The <title> tag declares the title for a webpage. The title of a webpage can be seen in the top left corner of the web browser. If you look at the top left corner of your web browser window right now, you will see the title HTML head section, as that is the title of this page.
Example:
Putting innapropriate tags in the head section
The above mentioned tags are the only tags that should go in the head section of an HTML document. If you try to put any other tags in the head section of an HTML document, most browsers will display their content, but this will be semantically incorrect and will result in a page that does not validate with a page validator. This is a bad practice and should be avoided.




