The framework for a simple HTML document consists of a head and body. The head provides information about the document to the browser (and sometimes also to the web server), and the body contains content that appears in the browser window. The first step in creating any HTML document is to define its framework.
An HTML document consists of a collection of markup elements — some required, many optional — where you can always find at least three elements:
The opening and closing tags follow the DOCTYPE declaration and contain everything else inside the HTML document.
The opening and closing tags follow the opening tag. They contain definitions, labels, and information about the HTML document body that follows.
Only certain markup elements are legal inside an HTML document head (which is another way of saying “may appear between the and tags”). The legal elements include base, link, meta, script, style, and title. (Collectively, these are known as HTMLHeadElements in the language of the HTML5 specification.)
The opening and closing tags follow the closing tag. They include the content and related markup for the HTML document. This is where 99 percent of the stuff that actually appears inside a web browser lives.
Any HTML markup element can appear in an HTML document body unless that element is the DOCTYPE, a major organizational container (namely, , , or ), or an element allowed only in a document head.
You could create an HTML document with no content in the , but why would you want to? It would display only a title and no other information.
Likewise, you could build a complex body with only minimal markup in the section (the