HTML for World Wide Web users

by Ginny Hudak-David, Publications Editor, Publications Group Illustration by John Havlik

"Is this HTML coding stuff really hard to do? How do I get started creating a file for a World Wide Web server?"

Jennie File, NCSA's Software Development Group trainer, reports being asked these and similar questions a lot during her training sessions for a variety of audiences, including NCSA staff. "Many people seem to think that they won't be able to do this--but they find out they can!"

Using HTML is not as difficult as you might think, and using NCSA Mosaic to view your efforts is particularly rewarding because of its graphics display capabilities.

NCSA Mosaic and the WWW

NCSA Mosaic software [see access, Fall 1993] is a browser--a hypermedia network navigation tool that lets you access information on the Internet by clicking on hyperlinks, also called anchors, in formatted documents. NCSA Mosaic formats files provided on servers, or computers that offer services and files to other machines. NCSA Mosaic is available for the Macintosh, X Window System, and Microsoft Windows platforms.

World Wide Web (WWW) servers use the HyperText Transfer Protocol (HTTP) to provide files. (Files can also be read from Gopher and anonymous FTP servers.) Files are identified by Uniform Resource Locators (URLs), which can be considered a file's address. A URL combines the server protocol, usually HTTP, with the machine address, the file's directory, and the filename in the following format:

protocol://machineaddress/directory/filename

HTML

Text files are coded for display in NCSA Mosaic (or in other Web browsers) using the Web formatting language called HTML (HyperText Markup Language), which is a subset of the Standard Generalized Markup Language (SGML). All word-processing software uses some kind of markup language, but the software you use probably hides the codes that tell your monitor or printer to show a word in boldface type, for example. When you create an HTML file, you insert a code or tag that tells the browser how to display some text, but the tag is visible only in the original file (see the illustrations). If you have never used a markup language, this may be a different way of thinking about a file. If you have used TeX or LaTeX, moving to HTML is easy.

One thing about browsers and coded files is a change for many authors--you are not able to have complete control over the final presentation of information. For example, in a word- processed document you can format a heading as you like: bold, larger point size, different font, centered. You design the page layout to suit the needs of your readers and to integrate with other documents as necessary. In an HTML-coded file, however, you tag the specific elements of the file, but the browser software formats the final presentation. This means that you cannot specify many details of the final presentation.

Getting started

Start by creating an ASCII text file--that is, either change an existing word-processed document into a text file by saving it as text with line breaks or start a new file as a text file. Common UNIX text processors are vi and EMACS; Macintosh users can try BBEdit, or their favorite word processor with carriage returns inserted at the end of each line prior to the final file save. Name your file with the .html extension (e.g., xfile.html).

Pairs of tags enclosed in angle brackets (< >) instruct the browser to format headings, insert graphics, or display words in bold or italics. The first angle-bracket tag starts the instruction; the second code angle-bracket tag--with the addition of a leading slash mark (</>)--ends the tag's instructions. If you are marking a first-level heading in your file, enclose the text between the level one heading tags as shown: <h1>Hardware enhancements</h1>. There are HTML tags for lists, quotations, headings, emphasis, and other common presentation styles. (See "For more information" below.)

Hyperlinks

Hyperlinks connect words or graphics with related files located anywhere on the Internet. WWW browsers display the hyperlink anchor in color or underlined. Hyperlinks can point to text, image, sound, or movie files.

To include a hyperlink in a file, you must have the file's URL. For example, to make a hyperlink to the NCSA Home Page, you would include this HTML code:

<a href="http://www.ncsa.uiuc.edu/General/NCSAHome.html" >NCSA</a>

The href= section gives the file's URL enclosed within quotation marks. The word NCSA, enclosed between the right angle bracket (>) and the end of the anchor tag (</a>), will be shown in color or underlined in your window. (The start of the anchor tag is at the very beginning: <a.)

GRAPHICS

Most file authors want to include graphics in their files. NCSA Mosaic can display X bitmap or GIF file format images inside a formatted document. Graphics are scanned and manipulated using an art production tool such as Adobe Photoshop.

Scan, size, and save your image in an X bitmap or GIF format. Use the appropriate extension when naming your file (.xbm, .gif). You can also create and save images from your monitor screen by using a program such as FlashIt for the Macintosh, a screen-capture utility that freezes your screen and lets you take a snapshot of any or all of the current display.

To include a graphic in your file, use the <img src> tag, which tells your browser to retrieve and display the image file referenced in the URL. In this example, the file that will be displayed shows the copyright symbol ():

<img src="http://www.ncsa.uiuc.edu/General/Copyright.xbm">

Putting it together

Once you have your HTML coded file and any graphics files created, you may want to make them available to the Internet community. Sharing information requires a WWW, Gopher, or anonymous FTP server. For information on establishing a WWW server, see "For more information" below.

By putting the pieces together--HTML tags, images, and hyperlinks--you can create an interesting and informative formatted document that tells other Internet surfers about your work. Maybe you will be able to say, as someone recently did to Jennie File, "Gee, this is fun!"

For more information

Refer to the following online files for additional information:
A Beginner's Guide to HTML
http://www.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimer.html

A Beginner's Guide to URLs
http://www.ncsa.uiuc.edu/demoweb/url-primer.html

Information about HTML
http://info.cern.ch/hypertext/WWW/MarkUp/MarkUp.html

Establishing a server
http://hoohoo.ncsa.uiuc.edu/docs/Overview.html

More information on NCSA Mosaic
http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/NCSAMosaicHome.html


access / Fall 1994 / NCSA