Getting Started with HTML
HTML (Hypertext Markup Language) uses a markup system composed of elements which represent specific content. Markup means that with HTML you declare what is presented to a viewer, not how it is presented. Visual representations are defined by Cascading Style Sheets (CSS) and realized by browsers. Still existing elements that allow for such, like the <font> tag, are entirely obsolete, and must not be used by authors.
HTML is sometimes called a programming language but it has no logic, so is a markup language. HTML tags provide semantic meaning and machine-readability to the content in the page.
An element usually consists of an opening tag (<element_name>), a closing tag (</element_name>), which contain the element's name surrounded by angle brackets, and the content in between:
<element_name>...content...</element_name>
There are some HTML elements that don't have a closing tag or any contents. These are called void elements, such as <img>, <meta>, <link>, and <input>.
Hello World Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello!</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is a simple paragraph.</p>
</body>
</html>
Simple Page Breakdown
- <!DOCTYPE>: Defines the HTML version used in the document. It is HTML5 here.
- <html>: Opens the page. The lang attribute declares the primary language (en).
- <head>: Contains metadata, imports, title, etc.
- <meta>: Provides document metadata, such as charset encoding (UTF-8).
- <title>: Sets the page title.
- <body>: Contains all visible/audible content of the page.
- <h1>: Level 1 heading for the page.
- <p>: Represents a paragraph of text.
HTML Version Timeline
| Version | Specification | Release Date |
|---|---|---|
| 1.0 | N/A | 1994-01-01 |
| 2.0 | RFC 1866 | 1995-11-24 |
| 3.2 | W3C: HTML 3.2 Specification | 1997-01-14 |
| 4.0 | W3C: HTML 4.0 Specification | 1998-04-24 |
| 4.01 | W3C: HTML 4.01 Specification | 1999-12-24 |
| 5 | WHATWG: HTML Living Standard | 2014-10-28 |
| 5.1 | W3C: HTML 5.1 Specification | 2016-11-01 |