HTML Page Structure

    The basic layout or structure of an HTML document is as given below:

    <!DOCTYPE>
    <html>
    <head>
    ...
    </head>
    <body>
    ...
    </body>
    </html>


    <!DOCTYPE>

  • It is not an HTML tag. It can be called a declaration which must be given as the first line of the document.
  • <!DOCTYPE> declaration tells the browser that which version of html we are going to use. It is case- insensitive. All cases are acceptable:
  • 1. <!DOCTYPE html>

    2. <!DOCTYPE HTML>

    3. <!doctype html>

    4. <!Doctype Html>



    Common Declarations

    HTML 5

    <!DOCTYPE html>


    HTML 4.01

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD
    HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/
    loose.dtd">


    XHTML 1.0

    <!DOCTYPE html PUBLIC "-//W3C//DTD
    XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/
    xhtml1-transitional.dtd">


  • eitworld.com use <!DOCTYPE html> in all the examples, which declares that we are going to use HTML5.
  • <html>

  • The entire HTML document must be enclosed in <html> tag.
  • This is the first tag of HTML document which indicates that the content written in it should be treated as HTML code. Therefore this is the only compulsory tag for an html document as it starts the coding.
  • <head>

  • This tag encloses the Head Part of the document. This part contains the title of the document, JavaScript code, DHTML code, CSS code etc. by using several tags.
  • These tags are described in Head and Body Part.
  • <body>

  • This tag encloses the Body Part of the document. This part contains all the tags and the contents that will be displayed in the web page in a desired manner.
  • This is the widest part of HTML which you are going to study the most in this tutorial.

These tags are discussed in detail in next chapter.