![]() |
![]() |
|||||||||||||||||||||
Beginner's Guide to HTML |
||||||||||||||||||||||
PART 2 |
||||||||||||||||||||||
Creating an HTML FileHTML stands for HyperText Markup Language. It consists of various codes which are added to the text of a document to specify how you'd like that document to look when viewed using a Web browser (such as Netscape). The precise way the document looks is determined by the browser used and the setups specified by its user, however. Most HTML codes are used in pairs consisting of a "begin" code and an "end" code. The codes "surround" the text to be formatted. For example, in front of each heading is a "begin heading" code and immediately after the heading text is an "end heading" code. Each code is contained within angle brackets. End codes contain a forward slash as a prefix. For example, the codes for a level one heading are <H1> at the beginning of the heading and </H1> at the end. The codes you choose to use are a matter of choice to some extent — and there are a lot of choices. Only the most basic layout codes are discussed in this handout. In addition, since the essence of the Web is its linking capability, basic linking codes are included. |
||||||||||||||||||||||
Before You BeginBefore you begin to create your home page it is a good idea to think about how the material you want to "publish" can be best organized. If you'll be including a lot of your own material, rather than creating one long document it may be preferable to create a hierarchy of shorter documents linked to a "main" page and possibly to each other. If you'll only be including links to other sources, perhaps one document of your own is sufficient. No matter how you decide to organize your material, it is a good idea to name your main (or only) document index.html (see Part 3: Saving and Viewing Your HTML Document). Next, read through this entire section on creating an HTML file before you start so as get a feel for what you'll be doing. Then create your first home page. Start with something simple. You can always embellish later on.
Open a Text Editor and Get StartedAn HTML file is nothing more than a text-only file with a special filename extension (.html). You can use a text editor such as Notepad (in Windows), SimpleText (on a Macintosh), or pico (in your CSUN network account) to create your Web page (HTML) files. If you create your files directly in your network account (using pico), you avoid having to transfer the files into your account, but you can't check your work (i.e., make sure your page is readable and your links work) without allowing anyone who has access to the Web to see your file and, perhaps, your mistakes. This documentation assumes you will use a desktop text editor (such as Notepad or SimpleText) to create your files.
Coding Your FileRequired CodesInclude the following codes (tags) in each of your Web documents.
<HEAD>header-information</HEAD>
<TITLE>document-title</TITLE>
<BODY>all-document-text</BODY>
There are a couple of ways to code a document very quickly, albeit not very interestingly. You can insert paragraph tags to separate paragraphs (with no other formatting) or you can use the "preformat" tag for an "as is" display of your document text.
<PRE>preformatted-text</PRE>
Other Formatting TagsBreaks. In addition to the paragraph break tag (described under "Quick Formatting" above), there are two other tags commonly used to break — or separate — lines of text.
<HR>
Headings. Each document will probably have at least one main heading and possibly other lower-level headings. There are six levels of headings which can be specified. For each heading in your document, choose the level desired and type the begin and end codes and the beginning and end of the heading text. <H1>heading-text</H1>
<H2>heading-text</H2>
<H3>heading-text</H3>
Lists. An easy-to-read way of organizing and linking information is to display items in a list. There are HTML codes for several types of lists. Two are mentioned below. For each type of list there are begin and end list codes as well as codes to designate each item in the list.
<LI>list-item <LI>list-item </OL>
<UL>
Links. The essence of Web browsing is following all those links you find on the Web pages you read, and it's quite likely that you'll want your home page to link to other documents — another of your own documents, to a document somewhere else at the University (such as the Cal State Northridge home page), or to a document located somewhere else in the world. It is also possible to link to different locations within the same document. Each link requires an anchor and a HyperText REFerence to the location to of the linked page.
Coding
Sample
|
||||||||||||||||||||||
August 14, 2003 |
Prepared by Gail Said Johnson, User Support Services |
|||||||||||||||||||||
ITR's technology training guides are the property of California State University, Northridge. They are intended for non-profit educational use only. Please do not use this material without citing the source. |