-->
Previous Table of Contents Next


Chapter 32
Creating Web Documents with HTML

by Steve Burnett

In this chapter
Understanding HTML
Working with HTML
Using Basic HTML Elements
Understanding HTML Syntax

In Chapter 31, “Surfing the Internet with the World Wide Web,” you learned how to access the World Wide Web and were introduced to the various types of information available. You can click hypertext links and jump from place to place as fast as your connection allows. You can see Web pages with snazzy graphics and sound, lists, forms, and all sorts of neat stuff. But how do you actually create a Web page that other Web users can get to? It’s not really as difficult as you might think. All you need is access to a Web server that uses Hypertext Transport Protocol (HTTP) and a set of documents written in Hypertext Markup Language (HTML).

This chapter looks at HTML to see what’s involved in writing Web pages using HTML.

Understanding HTML

The Hypertext Markup Language (HTML) is the language used to develop Web pages and documents. HTML isn’t a programming language like C++, Java, Pascal, or Perl; instead, it’s basically a cross-platform markup language that’s designed to be flexible enough to display text and other elements (such as graphics) on a variety of viewers.

An HTML document consists of special tags that are embedded in an ASCII document. These tags are interpreted by Web browser programs, which format and display documents.


NOTE:  HTML is a subset of Standard Generalized Markup Language (SGML), which is an international standard (ISO 88791) for electronic document exchange. SGML is a meta-language for defining and standardizing the structure of documents. SGML also describes a grammar you can use to design other markup languages. Any valid HTML document is also valid SGML. Like any SGML derived language, HTML’s grammar is described by a Document Type Definition (DTD) file.

HTML tells Web browsers how to display Web documents; however, the format information HTML provides is pretty general. Many different Web browsers are available for the Internet, such as Netscape Navigator, Microsoft Internet Explorer, or NCSA Mosaic. Many run under graphical interfaces such as the X Windows system or MS Windows. Some, such as Lynx, are ANSI browsers and are limited in terms of which graphical characteristics they can display.

As you write HTML documents, remember that they will look different depending on which browser the reader is using. All available Web browsers try to format HTML documents as properly as possible; however, what you see may not be what someone else using a different browser or even the same browser running under a different operating system sees.

Working with HTML

As tools for the Web continue to evolve, creating HTML documents keeps getting easier. Many of the new tools hide much of the actual HTML coding from you. All you have to do is write the words, format your document, and save it to an appropriate location. Some browsers, such as Netscape Navigator Gold, include an editor that lets you point and click to create HTML pages. Other point-and-click tools include Microsoft FrontPage, Adobe PageMill, Allaire HomeSite and Macromedia DreamWeaver.

If you don’t want to use an HTML editor or already have documents you want to put on the Web, there are several software applications you can use to convert word processing, desktop publishing, spreadsheet, or other documents into HTML. Newer versions of software packages, such as Adobe Framemaker, will include HTML as an option when you save a file.


ON THE WEB:  
The following Web site has lots of conversion software available:
http://www.yahoo.com/Computers_and_Internet/Software/Internet/World_Wide_Web
/HTML_Converters/

At some point, you’ll want to try your hand at creating your own HTML. Although many tools are available to help make writing HTML less tedious, you’ll probably find that they won’t let you do everything you want.

You’ll also find that HTML is relatively easy to work with. Because HTML is an ASCII-based markup language, all you need is an editor that will let you save files in ASCII format and a Web browser that you can use to view your Web pages as you develop them. You don’t need a network connection to develop Web documents. Any Web browser should let you open a local HTML file and view it as though you had retrieved it from the Internet.


NOTE:  You may find that using an HTML editor is useful. Some editors allow you to select the text you want to format and then apply HTML tags from a menu rather than type the tags in yourself. Other editors look more like word processors—you select the text and select the type of formatting you want from a toolbar. In either case, you’ll probably need to edit the HTML directly to get the exact look and feel you want.


ON THE WEB:  
You can check out some editors from Sausage Software HotDog/HotDog Pro and Macromedia’s at the following URLs (respectively):
http://www.sausage.com
http://www.macromedia.com

You can find a listing of HTML editors at this address:

http://www.yahoo.com/Computers_and_Internet/Software/Internet/
World_Wide_Web/HTML_Editors/

Before you go any further into the syntax of HTML, look at a Web page and its HTML source code. Figure 32.1 shows a simple Web page.


FIG. 32.1  A simple HTML page.

Listing 32.1 shows the HTML source for this Web page. Here you’ll see the basic elements of an HTML page.

Listing 32.1 Source Code for a Simple HTML Page


<HTML>



<HEAD>

   <TITLE>Hello Web!</TITLE>

</HEAD>



<BODY>

<H1>Hello!</H1>

This is the body section of a simple HTML page.

<P>

<IMG src=“example.gif”>



</BODY>



</HTML>


Previous Table of Contents Next