HTML head section
It is said that sometimes what you don't see is very important, and this holds true for HTML documents. The information placed in the head section of an HTML document is not seen on a webpage but is very important for the page itself.
The head section of an HTML document begins with <head> and ends with </head>.
Tags placed inside the head section of an HTML document:
-
<title>
Sets the title of a webpage
-
<base>
Sets a base URL for the links on a webpageNOTE: This tag has no end tag
-
<link>
Links to another documentNOTE: This tag has no end tag
-
<meta>
Stores information about a document such as keywords for search engines and what software was used to create the documentNOTE: This tag has no end tag
Another important tag that describes a webpage in some way is the <!DOCTYPE> tag. This tag specifies what kind of document an HTML document will be.
For HTML documents that use deprecated features such as the <font> tag use the transitional document type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
For HTML documents that contain frames, use the frameset document type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
For HTML documents that use CSS and no deprecated features such as the <font> tag use the strict document type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
For XHTML documents that use deprecated features such as the <font> tag use the transitional document type:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
For XHTML documents that contain frames, use the frameset document type:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
For XHTML documents that use CSS and no deprecated features such as the <font> tag use the strict document type:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
NOTE: The <!DOCTYPE> tag should be the first line of code in an HTML document!




