Markup Languages

Markup Languages

HTML is a markup language. A markup language is a method of indicating within a document the roles that the document's pieces are to play. Its focus is on the structure of a document rather than its appearance. For example, you can indicate that one piece of text is a paragraph, another is a top-level heading, and another is a lower-level heading. You indicate these by placing codes, called tags, into the document. HTML has around 30 commonly used tags, which are reviewed later in this chapter. You could, for example, use a tag that says, in effect, "Make this piece of text a heading."

In contrast, desktop-publishing (DTP) programs emphasize the presentation of a document rather than its structure. Authors can select font families, text colors, and margin widths and thereby accurately control what the final product – which normally ends up on paper – looks like.

The distinction between structural and presentational systems isn't always as clear cut as what we've described. HTML, while having its roots in structured documents, has some tags that describe presentation rather than structure. For example, you can specify that a text should be presented in bold or italic. Also, some DTP programs let you describe the structure – in addition to the presentation – of a document. When you create a new document in applications such as Microsoft Word or Adobe FrameMaker, a standard set of styles is available. A style is a group of stylistic characteristics that you can apply to a piece of text. For example, you may have a style called title 1, that has the characteristics that sets the text to 18 point Helvetica bold italic. (If you're not familiar with what "18 point Helvetica bold italic" means, don't worry; we explain it in Chapter 5, "Fonts.") By applying the style title 1 to selected parts of your document, you effectively mark it up. At the same time, you also specify how those pieces of text should be presented. Figure shows what 18 point Helvetica bold italic looks like.

1. 18 Point Helvetica Bold italic.

Conceptually, this is similar to HTML and CSS. In HTML, title 1 would be a tag, and the stylistic characteristics (namely, 18 point Helvetica bold italic) would be written in a CSS style sheet. If you already know a DTP program that supports this notion of styles, the transition to HTML and CSS will be easy.

     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows