What is HTML?

HTML stands for Hyper Text Markup Language. HTML is the standard markup language for describing web pages. A markup language is a set of markup tags. HTML documents are described by HTML tags. Each HTML tag describes different document content. HTML along with JavaScript and CSS is the main technology for creating web pages and these are also used to create the interface for mobile applications. For a webpage, HTML describes the content and the structure of the web page, CSS defines the styles of the web page and JavaScript is used to add certain functionalities like click events on buttons, etc. One of the major benifits of HTML is that it allows linking to other documents quite easily.
To know the difference between markup, scripting and programming language, please check here.

What is HTML5?

HTML has been around since the early 90s and the last major version - HTML4 - was released in the late 90s. HTML5 is the latest version of HTML, released on 2014 by W3C. It improves the markup by adding many semantic elements, adding support for multimedia, adding a number of APIs, dropping deprecated elements in HTML4. HTML5 is also a great option to build cross platform mobile applications as it is well supported by low powered mobile devices.

HTML - elements, tags and attributes

A HTML document is similar XML in case you are familiar with it. HTML document contains an element or tag which may or may not have attributes. For example, this is a simple div tag with class attribute.

    Div element: <div class="class1" id="div1">some content</div>
    Paragraph: <p class="class1" id="div1">paragraph</p>
    Line Break: <br />
    Link: <a href="#" title="link to my page">click here</a>
    Comment: <!--some comments about this page-->

In the above examples, the elements like a div or a para starts with the element names - div, p, a - following by optional attributes or properties of the element and then within the element is some content which is part of the document that is readable through the browser. So, basically, within the elements, only the text within the elements will be displayed on the browser. The actual markup is used by the browser for displaying the content. Note, that search engines use the markup to determine the importance or the content. For example, though h1 and a div tag can be made to appear on the browser the same using css, but search engines will associate different meaning based on whether it's a h1 tag or div tag.

Structure of a pre-HTML5 document

Prior to HTML5, HTML did not have semantic markup and therefore it was difficult to distinguish the content. Here is how a typical website would appear.

    <html>
        <head>
            <meta name="description" content="description of this page" />
        </head>
        <body>
            <div id="id1" class="navigation"></div>
            <div id="id2" class="header"></div>
            <div id="id3" class="content"></div>
            <div id="id4" class="content"></div>
            <div id="id5" class="footer"></div>
        </body>
   </html>

With semantic markup introduced in HTML5, a typical structure of a HTML document would look like below.

    <html>
        <head>
            <meta name="description" content="description of this page" />
        </head>
        <body>
            <nav id="id1"></nav>
            <header id="id2"></header>
            <div id="id3" class="content"></div>
            <div id="id4" class="content"></div>
            <footer id="id5"></footer>
        </body>
    </html>

Note: The default character set of HTML5 is Unicode UTF-8. ASCII was the previous standard encoding for HTML.