Understanding TagsA Web document, as we have seen, is created using something called HTML. HTML is a "markup language." What this means is that the document basically contains the text we want to display, but that this text has been "marked-up" to indicate how it should be displayed. This is done by placing tags in the document along with the text.
The tags themselves are nothing more (or less) than special sequences of characters that are unlikely to occur in normal text. These sequences begin with an "open-angle-bracket," or in other words, less-than sign ("<"), and they end with a "close-angle-bracket" or greater-than sign (">"). What goes in between the brackets are special keywords that indicate what the tag signifies. The first keyword determines what type of tag it is.
For example, there is a tag that looks like this: <P> This tag is called the "P-tag." (It designates a paragraph break -- about which we will say more in a moment -- but that is beside the point right now.) The keyword (in this case "P") is usually chosen to remind you in some way about the function of the tag. Most are abbreviations.
Some tags stand on their own (the P-tag is one of these). However, most tags occur in pairs. In this case, there will be one tag that is a starting tag (having a particular keyword), and a matching closing tag that has the same keyword preceded by a slash ("/"). These tags surround the particular piece of text (a character, a word, a phrase, or even an entire section of a document) that they are meant to affect.
For example, a hypothetical X-tag pairing could be used to mark the words "this text is marked" as follows:
<X>this text is marked</X>
So, an HTML document is nothing more than a plain ASCII text file that contains tags. The file extension ".html" is used as part of the file's name to let the server know that a particular document is an HTML document and not just ordinary text (otherwise it would have no way to tell).