<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Guide to Hypertext Markup Language</title>
<META Name="description" lang="en" Content="An introduction to writing hypertext markup language (HTML), including a list of common tags and codes.">
<META Name="keywords" Content="guide to HTML, handout on HTML, learning hypertext markup language">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="stylesheet" TYPE="text/css" HREF="/styles/standard.css">
</head>
<body>
<div align=center><p><br>
<table class="tableborder" width="600" border="0" cellspacing="0"
cellpadding="20">
<tr>
<td>
<!--#include virtual="/inc/top.html" -->
<p>
<!--    end header    -->
<!--   start here to copy sectional path nav   -->

<hr align="left" width="70%">
<a href="../index.html">Handouts</a> &#187;
<a href="index.html">HTML Handouts</a> &#187;
HTML Guide
<hr align="left" width="70%">
<P>
<!--   end sectional nav  -->



 <h1>A Guide to HTML<br>
(HyperText Markup Language)</h1>
<p><br>
<h2>About Web Pages</h2>
<dl><dt>
<b>The Web Directory Location</b>
<dd>These files must reside in your
<strong> public_html</strong> directory. The name of this special
directory can vary - it's chose by the system administrator at your web
host. But public_html is the most common. Your pages must be placed in
this special directory. If they're placed in a different directory, no one
can see them.
<p>
<dt><b>Naming Files</b>
<dd>There are two issues to keep in mind when naming web page files: the
<b>filename extension</b> and the <b>home page</b>. The file name of any
web page must end with the extension <strong>.html </strong> and be
created as ASCII text (ie, plain text, not containing formatting by
any word processor). Some web hosts require the extension <b>.htm</b> as
an alternative.
<p>
The <b>Home Page</b> is a special concept. A web site Home Page is
usually the "introduction" to the site. It's the front door, the
first impression and ultimate guide to the site's content. The Home Page
must bear a special file name, and this name is usually <b>index.html</b>.
Some web hosts choose to use a different file name to identify the Home
Page, default.html or welcome.html - it does vary and you'll need to check
with your web host to discover which naming convention should be used.
<p>
What purpose does this special filename serve? It allows a person to omit a
file name from a URL. Compare the following two URLs:
<p align=center>
<tt>http://theflyingcat.com/<br>
http://theflyingcat/paula.html
</tt>
</p>
The first URL contains no file name, so how does the web server know what
file to deliver to you? It knows that if no file name is specified it should
"default" to the file named index.html (or whatever default file name
has been chosen). The second URL does contain a file name, paula.html,
and that file will be delivered to you.


<p>
Aside from the Home page, you may name your web pages any way you choose
(provided of course that you include the .html extension).
</dl>
<p><br>



<h2>A Sample HTML Document</h2>

<TABLE BORDER = 2  CELLPADDING = 5><TR><TD bgcolor="#ffffff">


&lt;html&gt;<br>
&lt;head&gt;<br>
&lt;title&gt;Enter the URL title here&lt;/title&gt;<br>
&lt;/head&gt;<br>
&lt;body&gt;<br>
&lt;h1&gt;Enter the large heading for the page here&lt;/h1&gt;<br>
<p>

Enter your text and such here. This will be the main section for your web
page.

<p>

To make an indented section, use &lt;ol&gt; for a numbered list or
&lt;ul&gt; or an unnumbered, bulleted list. It is the &lt;li&gt; tag that
causes the number or bullet to appear.

<p>
&lt;ol&gt;<br>
&lt;li&gt; Begin each line to be indented and numbered or bulleted with
the &lt;li&gt; tag.<br>
&lt;p&gt;<br>
&lt;li&gt; If you don't use the &lt;p&gt; command to insert a blank line
between entries they will appear flush against each other.<br>
&lt;p&gt;<br>
&lt;li&gt; The hunter carries a &lt;a
href="http://www.cs.unca.edu/~edmiston/tool.html"&gt;
<strong>bag of tricks</strong>&lt;/a&gt;containing a handy
collection of tools.<br>
&lt;/ol&gt;<br>
&lt;p&gt;<br>
When you are finished with the list, turn off the list command.<br>

&lt;p&gt;<br>
&lt;pre&gt;
<pre>
The text inside a &lt;pre&gt; tag will appear in a courier font.

</pre>

&lt;/pre&gt;
<p>

The &lt;pre&gt; tag allows you to insert a bit of white space on a page.
This can be useful to create a sense of separation between sections.  The
&lt;/pre&gt; tag is more traditionally used to freeze text in place which
allows you to create easy columns and other specifically spaced text. The
down side of &lt;/pre&gt; is that it uses a courier font which can be
unattractive.<br>

&lt;p&gt;<br>
&lt;hr&gt;
<hr>
&lt;p&gt;
<p>
Here's how to allow people to send you email right off of your web page.<br>
Send email to &lt;a
href="mailto:samwise@samwisefish.edu"&gt;edmiston@cs.unca.edu&lt;/a&gt;<br>

&lt;p&gt;
<p>
This URL: http://www.cs.unca.edu/~edmiston/htstart.html &lt;br&gt;<br>
Return to &lt;a
href="http://www.cs.unca.edu/~edmiston/"&gt;Paula Edmiston&lt;/a&gt;
<p>
&lt;/body&gt;<br>
&lt;/html&gt;

</TD></TR></TABLE>


<p><br>
<h2>About HTML</h2>


The first thing to understand about HTML is that is doesn't recognize
white space. You can beat on the space bar all day and still wind up with
a document that's looks like somebody ripped off all your carriage
returns! Web browsers ignore blank spaces and carriage returns. There are
a couple of ways to deal with this.

<p>

A web page contains two parts: the head and body. The head is used to
contain special information about the document. We will address only the
title tag inside the head.  The body of the document is where all of the
content of your page is placed.

<p>

To insert a blank line between paragraphs use the paragraph tag:
&lt;p&gt;. I generally put it on a line by itself as a visual aid to my
human eye when I'm editing the document, and it's very helpful to have it
on a line by itself when troubleshooting. You are free to place it at the
end of a line as well (or in the middle of a line for that matter).

<p>

You can create a simple list with the break tag: &lt;br&gt;. This inserts
a break in the line so that the next text you enter will appear in the
line directly below. The difference between this &lt;br&gt; tag and the
&lt;p&gt; tag (which both break the line) is that the &lt;p&gt; tag
inserts a blank line after the break; the &lt;br&gt; does not.

<p>

The major problem I've run across in creating a web page is the
differences in the way various browsers present web pages. Some browsers
produce and effect for every HTML command, some just ignore them. Put
special effects in, but don't come to *rely* on them. Always consider the
text browsers.
<p><br>

<h2>HTML Tags</h2>

The basis of HTML is the tag command. These commands are always placed
inside pointy brackets: &lt;p&gt;. Some commands are used in pairs, ie,
the first command turns on the effect, the second one turns it off. Some
commands are not paired. These tags are used in much the same way as
formatting commands in word processing programs. The text inside the
pointy brackets (&lt;tiTlE&gt; &lt;H1&gt; &lt;htmL&gt;) can be entered as
upper case, lower case, or mixed case, it doesn't matter, the web browsers
reading the tags are case insensitive. I try to be consistent, I use lower
case because it's easier to type.  <p> There are many web browsers in use
and they all interpret tag commands differently! Generally speaking, if a
browser is unable to use a tag, the tag will be ignored. There are a few
tags you must use.

<p><br>

<h2>Essential Commands</h2>

<dl>
<dt>&lt;html&gt;       &lt;/html&gt;

<dd>This command always goes at the top of the document &lt;html&gt; and
at the bottom &lt;/html&gt;. It "opens" and "closes" the document. These
are the first and last lines.


<dt>&lt;head&gt;    &lt;/head&gt;
<dd>Goes at the top, encloses the &lt;title&gt;


<dt>&lt;title&gt;      &lt;/title&gt;

<dd>The title is the second item in the document. It is often used in
conjunction with the URL and is often a searchable field for webcrawlers
and spiders. So be sure to put relevant words here. It will appear in the
upper right corner of a lynx screen, along with pagination. It appears at
different places on the screen under other browsers. The title tag can
contain up to 64 characters.


<dt>&lt;body&gt;      &lt;/body&gt;

<dd>The open body tag comes immediately after the close title tag.  The
close body tag comes at the end of the document just
BEFORE &lt;/html&gt;. The &lt;/body&gt; tag will always be the penultimate
line (ie, next to the last). The <a href="bodytag.html">body tag</a>
is an essential tag to understand. This where you set colors for the page and
assign a background image.

</dl>

<p><br>
<h2>Subpages and Linked Pages</h2>

To make a subpage, just create a new file, with the extension .html and
link it to your main page with an ordinary link command:

<p>
<tt>The hunter gazes out over the endless stretches of the &lt;a
href="http://www.cs.unca.edu/~edmiston/dream.html"&gt;desert&lt;/a&gt;.</tt>
<p>
The reader of the page will see this:
<p>
<center>

The hunter gazes out over the endless stretches of the
<strong>desert</strong>.</center>

<p>

In this example the file being linked is named desert.html and the
highlighted text that is the selectable link is the word desert. Notice
that it doesn't matter where the line is broken. All web browsers will see
this as a single line. Just be careful to maintain a single blank space
between the &lt;a and the href.
<p>
All subpages you create should have the traditional footer (see above) and
they should include a <strong>return link</strong> that takes people back
to your main page or the page that provided the current link.
A Return-To link looks like this:
<p>
<tt>Return to &lt;a
href="http://www.cs.unca.edu/~edmiston/"&gt;Paula Edmiston&lt;/a&gt;.</tt>
<p>
And is seen as ...<br>
Return to <strong>Paula Edmiston</strong><br>
Where the bold words are the hyperlink.
<p><br>

<h2>Unpaired commands</h2>

&lt;hr&gt; Centers a ruler line on the screen.<br>
<hr>
<p>

&lt;hr size=5&gt;
<HR SIZE=5>
<p>
&lt;hr size=10&gt;
<hr size=10>
&lt;hr width=&quot;50%&quot;&gt;
<hr width="50%">
<p>
&lt;hr align="right" width="25%"&gt;
<hr align="right" width="25%">
<p>
&lt;hr noshade&gt;
<hr noshade>
<p>
&lt;hr width="25%" noshade size=5&gt;<BR>
<hr width="25%" noshade size=5>



<p>
<dl>
<dt>&lt;p&gt;
<dd>The paragraph mark. Inserts a blank line.
<dt>&lt;br&gt;
<dd>Line break. Inserts a line break, ie, starts a new line
with the following text.  Does not insert a blank line.
<dt>&#38;nbsp&#59;
<dd>A blank space. You can repeat this tag for more space.
</dl>
<p><br>
<h2>Paired Commands</h2>
<dl>
<dt>You can make the paragraph tag into a paired tag by including
alignment commands:
<dd>&lt;p align="center"&gt;centered text here&lt;/p&gt;

<dt>&lt;blockquote&gt; &lt;/blockquote&gt;
<dd>Used to indent both left and right

<dt>&lt;blockquote&gt; &lt;/blockquote&gt;
<dd>Indents the text from both left and right. You can nest this tag to
increase the indentation.

<dt>&lt;em&gt; &lt;/em&gt;
   <dd>Italics in a graphics browser and underlined in a text browser. I
prefer this command to &lt;i&gt; &lt;/i&gt; because the em tag is
recognized by more browsers.

<dt>&lt;strong&gt; &lt;/strong&gt;
<dd>Boldface in a graphics browser; underlined in a text browser. I prefer
this tag to &lt;b&gt; &lt;/b&gt; because the strong tag is recognized by
more browsers.

<dt>&lt;h1&gt; &lt;/h1&gt;

<! this is a secret comment from paula>

<dd>Formats the text as header level 1. In lynx the &lt;h1&gt; tag centers
the text in all caps. In other browsers it appears large, bold and
centered. These header levels go down to &lt;h6&gt;, the smallest.
<dt>You can insert formatting commands into the heading tag:
<dd>&lt;h1 align="center"&gt; &lt;/h1&gt;


<dt>&lt;center&gt;&lt;/center&gt;
   <dd>Centers text in some browsers.
<dt>&lt;pre&gt; &lt;/pre&gt;

   <dd>Lets you absolutely control text placement. But in a graphics
browser the text looks like courier font. Kinda ugly. Pre means
'preformatted'. The browser does not interpret the text, just displays
it.

<dt>&lt;!--  any text  --&gt;
   <dd>This is a private comment. The frame:   &lt;!-- any text  --&gt; surrounds
the comment, which will not be displayed in a browser.

<dt>&lt;font size=9&gt; &lt;/font&gt;
  <dd>The font size tag lets you choose a point size without using the
  &lt;h2&gt; commands. The advantage of the font command is that, unlike
the H commands, it does not insert a blank line above and below the text.
Font sizes range from 1 (one), tiny on up past 9, very large.
<dt>&lt;font color="#999999&gt; &lt;/font&gt;
<dd>The font color tag changes the color of plain text in a document. Use
this command <strong>very little or not at all</strong>. Nothing looks
worse on a pages than a wild, random selection of colors. I recommend you
do not use this command at all, as it makes identifying <strong>link
colors</strong> very difficult.

<dt>Combining font tag attributes
<dd>You can include several font tag attributes in one tag.<br>
&lt;font face="comic sans ms" size=+1&gt;Funky Text&lt;font&gt;

<dt>&lt;tt&gt; &lt;/tt&gt;
<dd>The tt command makes text appear as in a courier font. This command is
often used to format email address and other text where the appearance
must be exact. (tt = typewriter font)

<dt>&lt;pre&gt; &lt;/pre&gt;
<dd>Like &lt;tt&gt; formats text with a courier/typewriter
font. But this
command will format entire files of text, freezing it in place. Useful
for adding a lot of blank space to separate sections.

</dl>
<p><br>

<h2>List Commands</h2>


There's a rather extensive <a href="lists.html">handout on HTML list
commands</a> available to help you sort this out.

<p><br>


<h2>Embedding Links in Your Page</h2>


<h3>A note on link text</h3>

The highlighted text that you select to open a link is called the "link
text". Choose your link text with care. Never make the link text "click
here". Instead, make the link text descriptive of the document, or page,
that is about to open. It is important that the text on your web page flow
and read as natural language. Never make the link text sit awkwardly in a
sentence. It takes practice to craft a sentence that reads well and yet
contains appropriate, descriptive link text. <a
href="http://www.mripermedia.com/Rossin/">Antonio Rossin's page</a> is a
good example of appropriate link text.

<p><br>


<h2>Entering a hypertext link</h2>


<tt>The &lt;a
href="http://www.cs.unca.edu/~edmiston/csci121.html"&gt;Internet Class
 Syllabus&lt;/a&gt; contains links to required readings.</tt>

<p>
The person browsing the page will see:
<p>

<center>The <strong>Internet Class Syllabus</strong> contains links to
required readings.</center><br>
 The boldfaced words are the link.

<p><br>
<a name="graphics"></a>
<h2>About Graphics: Entering a Picture</h2>

Making a graphic image appear on your page is called setting an
<strong>inline graphic</strong>
<p>

<tt>&lt;img src = "images/cat.gif" width=102
height=139 align=right alt="The library Cat"&gt;</tt>

<p>
<img src="images/cat.gif" width=102
height=139 align=right alt="The Library Cat" hspace=10>

Use the ALT command for browsers that can't display graphics.
People in a text browser will see the word(s) associated with
the alt: <b>The Library Cat</b>. People with a graphics browser
will see your graphic of the cat (which is the file named <b>
cat.gif</b>, held in a subdirectory named <b>images</b>). Always
make the alt text descriptive of the <b>function</b> of the
images, <b>not descriptive of the image</b>.
<p>
It is often appropriate to enter a <strong>blank alt statement
</strong>, as in <strong>... alt=""</strong>. If the image is
"eye candy", then it's not appropriate to include text in the
alt statement. But if the image adds significantly to the
content, enter text inside the double quote
marks.

 <p>
Anytime you include an image on a web page you should also
include the <strong>width and height attributes</strong> as well
as an <strong>alt statement</strong>. How do you determine the
width and height of an image? There are many graphics programs
that will give you the figures. You can open the image in
Netscape and view these figures in the title bar of the window.
Click the <strong>right mouse button ON the image</strong> and
select <strong>View image</strong>.

<p>
You can use a graphic image as a hyperlink	In the example
below, the image the of the cat is a hyperlink to the
web page about the Library Cat, named <b>libcat.html</b>.
<p>

&lt;a href="libcat.html"&gt;&lt;img align=left
alt="The Library Cat" width=102 height=139
src="images/cat.gif"&gt;&lt;/a&gt;
<p>
<a href="../../fun/libcat.html">
<img align=left width=102 height=139
alt="The Library Cat"
src="images/cat.gif" hspace=10></a>

Notice the border around the image; this is a visual indication
that this image is a hyperlink.	 You can omit the border by
setting the <b>border attribute</b> to zero:
<p>

&lt;a href="libcat.html"&gt;&lt;img align=left
alt="The Library Cat" width=102 height=139 <b>border=0</b>
src="images/cat.gif"&gt;&lt;/a&gt;


<p><br>

<h2>Entering a gopher</h2>



<tt>The &lt;a href="gopher://gopher.unca.edu/"&gt;UNCA Gopher&lt;/a&gt;
offers a calendar of on campus events.</tt>

<p>
People will see the line this way:
<p>
The <strong>UNCA Gopher</strong> offers a calendar of on campus events.

<p><br>

<h2>Entering a telnet</h2>


<tt>Telnet into the Atlanta Fulton Public<br> Library
&lt;a href="telnet://afplpac.af.public.lib.ga.us"&gt;Catalog&lt;/a&gt;
to find something good to read.</tt><br> This line will appear as:

<p>

Telnet into the Atlanta Fulton Public Library
<strong>Catalog</strong> to find something good to read.


<p>
A telnet link using a port number:
<p>
<tt>The oldest, and most famous moo on the Internet is &lt;a
href="telnet://lambda.moo.mud.org:8888"&gt;LambdaMoo&lt;/a&gt;.</tt>
<p>

<center>The oldest, and most famous moo on the Internet is
<strong>LambdaMoo</strong></center>

<p><br>

<h2>Entering an FTP</h2>


<tt>Some sample files are available at &lt;a
href="ftp://ftp.cs.unca.edu/pub/davidson/class"&gt;Paula Edmiston's FTP
site&lt;/a&gt;.</tt>

<p>
Some sample files are available at <strong>Paula Edmiston's FTP site</strong>
<p><br>

<h2>Usenet Newsgroups</h2>

Usenet Newsgroups follow a different pattern in the URL. The double
slashes following the colon are omitted (but the colon is retained).
For example
<p>
Notices of academic import are made available in the
&lt;a href="news:unca.csci"&gt;unca.cscil&lt;/a&gt; newsgroup.

 <p>
Notices of academic import are made available in the
<strong>unca.csci</strong> newsgroup.

<p><br>

<h2>Mail Links</h2>


The following entry will allow people using a variety of browsers to send
you an email message directly from your web page. This command is not
supported by some web browsers.

<p>
Send comments about this web site to &lt;a
href = "mailto:samwise@samwisefish.com"&gt;samwise@samwisefish.com&lt;/a&gt;
<p>The above tag produces
<p>

<center>

<a href="../../sitemail.html">Send mail to paula</a>

</center>
<p>
Be sure to enter your complete email address where noted. Notice
your email address is also used as the link text. It's a good
idea to use your email address instead of your name because some
people are using web browsers that don't support the mailto tag,
or they just prefer to use a different email program. These
people will still have an email address they can use in their
regular email program.

<p><br>

<h2>Remember</h2>


Web browsers ignore blank space and carriage returns. You must use
&lt;br&gt; or &lt;p&gt; to force end of lines or to add a blank between
paragraphs. You cannot really indent text. But you can use the blank space
tag, <b>&#38;nbsp&#59;</b> to create a blank space.

<p>

The most useful thing I have found is to "view the source" of pages I come
across. In lynx you can view the source with the <strong>\</strong>
(backspace key). It is a toggle; enter \ to view source, enter \ again to
return to the formatted version.  In Netscape, open the View menu and
select "View Source". You can mail documents to yourself; in graphics
browsers be sure to select the format you want: text or html code. The
default in Netscape is HTML code! So you must select the "attachment"
button and correct the option to plain text.

<p>
<br>

<h2>Checking Your Web Page for Accuracy</h2>
I've recently discovered and adore a marvelous tool that actually checks
web pages for HTML errors! <a
href="http://www2.imagiware.com/RxHTML/">Dr. HTML</a>
checks for HTML problems as well as spelling errors and broken links!


<p><br>

<h2>Troubleshooting</h2>


<dl>
<dt>What if you don't see your changes?
<dd>Is the URL correct? Check that to confirm you are on the right page.
Did you click on the browser <strong>Reload button</strong>? Your
browser will not be aware of any changes you make. Clicking on the Reload
button causes the browser to "refresh" it's view of the page. Sometimes
you need an extra strong reload, if so, try <strong>Shift-reload</strong>.
That means, hold down the Shift key while you click on the Reload button.
<p>
<dt>Blank Page
<dd>If your page appears blank, but you know there should be content,
you may be using the table tag and have an error in your table tags.
The lack of a single tag can cause the entire page to appear blank!
<p>
<dt>Inappropriate Underlining
<dd>Everything underlined and appearing as a hyperlink? This can come
from an error in a link tag. Check to be sure the quote marks are in place
and the close tag is correctly written.


</dl>
<p><br>



<!-- footer -->
<!--#include virtual="/inc/foot.html" -->
<p>
</td></tr></table>
</div>
<!--#exec cgi="/cgi-bin/looker/ax.pl" -->
</body>
</html>
