HTML is an abbreviation that stands for HyperText Markup Language. It is the language of web pages—the markup language that browsers read to render web pages.
HTML refers to a markup language that has several versions. And web browsers and other user agents have varying levels of support for these versions. In general, the earlier a version is, the more browser support there is for that version.
What is HTML?
- HTML is not compiled. It is written and used without any changes being done to it. I starts out a text file, and is still a text file when a browser or user agent interprets it.
- HTML is human readable. While some other programing languages can be read by people (and not just machines), many times you have to learn the language to really understand it. In comparison, most HTML beginners can at least guess what an <img> tag does, for example.
HTML is made up of elements with attributes, some of the most common ones you would see include:
There are a number of versions of HTML that have been supported by web browsers:
- HTML 2.0
This was published as an IETF RFC in 1995. It was supported by some browsers like Mosaic.
- HTML 3.2
This version was the first W3C recommendation. It had wider browser support (partially because there were a lot more browsers). It became a recommendation in January 1997.
- HTML 4.0 and HTML 4.01
In December 1997, the W3C released this upgrade to HTML 3.2 as a recommendation. It added more features and tags and provided three versions: transitional, strict, and frameset. This was updated to 4.01 in December 1999 with a few changes to the specification.
- XHTML 1.0
XHTML 1.0 is a reformulation of HTML 4.01 under XML rules, and it was published as a recommendation by the W3C in January 2000. It has much stricter syntax and requires that any XHTML be valid and well-formed in order to display correctly. Most web browsers render XHTML 1.0 documents the same as they render HTML 4.01 documents.
HTML5 began being developed in 2004, when the W3C HTML working group decided to merge the HTML and XHTML tree to make HTML a purely XML-based language. This left designers and browser manufacturers who wanted a more flexible solution with the choice to give up or create their own new specification. They created a new group called the Web Hypertext Application Technology Working Group or WHATWG. HTML5 became a W3C working draft in 2008.
When choosing what version of HTML you should write, most designers base their decision on web browser support. The most common version of HTML is HTML 4.01 Transitional. It is supported in all modern browsers and provides most of the tags and features designers expect HTML to provide.
How to Define the HTML Version for Your Web Pages
With the exception of XHTML (which uses the XML namespace application/xml+xhtml to define the version for browsers), you should use the DOCTYPE tag. Such as:
HTML 4.01: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
HTML5: <!doctype html>