Introduction to Markup Languages
This section provides an introduction to two markup languages.
- XML: a general-purpose markup language (simple and regular)
- HTML: special-purpose markup language for Web documents (arose in a quirky irregular form, has gradually become more clean)
Markup languages
As opposed to a plain text file with .TXT file extension, markup languages enable a way to format text.
Markup tags provide additional information about the text display, such as:
- How to display it (
<i>
for italic,<ul>
for unordered lists) - What is the meaning of the text (
<h1>
means top-level heading,<button>
means a graphical button that can be clicked with the mouse) - Embedding non-text items such as images, videos, etc
Markup languages have been around since the 1960s, reinvented several times in the 70s and 80s, and became widespread by the late 1980’s. Before XML each person/group had their own custom format, there was no industry standard. Thus there were also limited tools for managing data.
Which version to use?
These days, HTML could refer to HTML or XHTML or HTML5.
HTML5 is the most common choice. XHTML is a better choice if choosing between HTML and XHTML, but in most general cases it won’t matter too much. Try to use XHTML when you don’t know which to choose. To choose, you’d specify at the top of an html file the doctype. Note that each of these versions have slight variations. Read HTML vs HTML5 vs XHTML: Understanding the Difference.