HTML Document Structure


Beyond the actual tags themselves the HTML document has some very basic structure. The below may look confusing but once you understand the parts it should be easier to read:


At the top of every properly formed HTML document is a document type declaration. This is not exactly a part of the HTML. It is just a way of telling the browser what the document is. Don't worry about what any of this means, just make sure that this is on the first line of your document:


After the doctype is the "<html>" tag, this begins the actual html which is divived into two sections. The head and the body. The head contains a bunch of invisible information, like styles, javascript, etc. It also contains the page title. Which isn't exactly invisible. It is displayed on top of the browser window.


The body is where all visible parts of the page reside. You can structure the content of the body section almost any way you like. Here is what what this pages body code look like and Here is what it would display in your browser.