Mimsy Were the Borogoves

Hacks: Articles about programming in Python, Perl, PHP, and whatever else I happen to feel like hacking at.

HTML & XHTML: The Definitive Guide

Jerry Stratton, September 13, 2001

When you write in HTML, you use ‘tags’ to surround your content and information about your content, in order to display them in some way to web browsers. A web browser is anything that reads your HTML files: it might be a graphical web browser such as Netscape or iCab, or it might be a voice reader used by the blind, or a search engine’s spider, or a web-enabled PDA. If you use intelligent choices in your HTML design, you’ll be able to handle all of these, and even browsers that haven’t been born yet.

Few, if any, of the inexpensive or free web page editors can produce this kind of widely-accessible HTML code. Front Page, perhaps the most widely-used of the free editors, has a reputation for producing HTML that can’t be read by anything other than Internet Explorer on the platform the code was produced on, and sometimes not even that!

If you want to produce web pages that increase your readership, you either have to purchase a more professional web page editor, or learn to create the HTML yourself, or, more likely, both. Fortunately, while sometimes tedious, HTML is not hard to understand. As long as you understand that you are surrounding information with tags that describe the information, everything else can be looked up in references such as this one.

All of your content has to be surrounded by something. You designate that your web page contains web page content by surrounding it with <HTML> and </HTML>. The ‘HTML’ tag ‘describes’ an HTML page. HTML tags are a keyword surrounded by a less than symbol (<) and a greater than symbol (>). The ending HTML tag also has a ‘/’ before the keyword.

There are two sections to your web document: the header, which contains information about the document, and the body, which contains the information you wish to convey—usually, the text that people will read. The header is surrounded by the HEAD tag, and the body by the BODY tag. You set the title of your document (in the header) with the TITLE tag. You set your main headline with the H1 tag and your paragraphs with the P tag. For example: