HTML Introduction

HTML is the standard markup language for creating web pages. It describes the structure of a webpage and consists of a series of elements.

What is HTML?

  • HTML stands for HyperText Markup Language.
  • HTML is the standard markup language for creating Web pages.
  • HTML describes the structure of a Web page using a series of elements.
  • HTML elements tell the browser how to display the content.
  • HTML elements label pieces of content such as headings, paragraphs, and links.

A Simple HTML Document

<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <h1>My First Heading</h1>
    <p>My first paragraph.</p>
  </body>
</html>

Code Explanation

  • <!DOCTYPE html>: Declares the document type as HTML5.
  • <html>: The root element of an HTML page.
  • <head>: Contains meta-information about the HTML document.
  • <title>: Sets the page title displayed in the browser tab.
  • <body>: Contains the visible content of the page.
  • <h1>: Defines a large heading.
  • <p>: Defines a paragraph.

What is an HTML Element?

An HTML element consists of a start tag, some content, and an end tag:

<h1>My First Heading</h1>
<p>My first paragraph.</p>

HTML Page Structure

Below is a visualization of an HTML page structure:

<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>

Note: The content inside the <body> section will be displayed in a browser, while the content inside the <title> element will be shown in the browser's title bar or page tab.

Web Browsers

Web browsers (like Chrome, Edge, Firefox, Safari) read HTML documents and display them correctly. A browser does not display the HTML tags but uses them to determine how to display the document.

HTML History

Since the early days of the World Wide Web, there have been many versions of HTML:

Year Version
1989 Tim Berners-Lee invented the WWW
1991 Tim Berners-Lee invented HTML
1993 Dave Raggett drafted HTML+
1995 HTML Working Group defined HTML 2.0
1997 W3C Recommendation: HTML 3.2
1999 W3C Recommendation: HTML 4.01
2000 W3C Recommendation: XHTML 1.0
2008 WHATWG HTML5 First Public Draft
2014 W3C Recommendation: HTML5
2017 W3C Recommendation: HTML5.2

This tutorial follows the latest HTML5 standard.