Reference for Basic HTML
[HTML] [Basic Tags] [Links] [Graphics] [Tables] [Forms] [Image Map] [Frames] [References]
HTML = HyperText Mark Language HT=hypertext Hypertext
refers to a collection of documents linked to one another by some simple method.
M=markup Markup tells the computer how to display a portion of text.
L=Language HTML is the language we use to make documents readable on the Web.
HTML is used to tell the computer three basic things about a document:
- how certain portions of the text are to be displayed
- what the relationship is of the document to other documents (or even portions of the
same document)
- basic information about the document, such as its title
HTML documents should:
- be understood by all computers and viewable from all monitor sizes.
- use hypertext to link them to other documents on the Web.
The content of HTML documents varies but every HTML document must have a the following
tags:
<HTML> {comment: Begins a document}
<HEAD> {comment: Begins the heading. The head contains
special information about your document including the title. }
<TITLE> {comment: Starts the title. The title will be
used at the top bar of the Browser window and as a search parameter and bookmark title, so
make your titles complete and meaningful.}
</TITLE> {comment: Ends the title}
</HEAD> {comment: Ends the head}
<BODY> {comment: Begins the body. This is the content of
your document. You can change the look of your document here with BACKGROUND,
BGCOLOR, and TEXT attributes}
</BODY> {comment: Ends the body}
</HTML> {comment: Ends the document}
[Top]
Basic Tag Examples:
- Headlines
Example H6
Example H5
Example H4
Example H3
Example H2
Example H1
- Paragraphs
this tag will end the line and put in an empty line {comment: end tag is optional; do not
use consecutive tags to gain vertical space, instead use a series of line breaks}
- Unordered Lists
- Ordered Lists
- item 1
- item 2
- Definition List
- item
- it's definition is indented
-Blockquote
indents the text, used for quotations in a block of text,
but also to force indentations
- Hard Rule
line used to divide parts of page {attributes WIDTH; SIZE and NO SHADE}
The following is an example of a normal HR
The following is an example of a 200 pixel noshade HR with a size of 4
-Fonts
You can change the appearance of your text with the font tag {attributes SIZE COLOR FACE}.
Be careful, however, because not all browsers have sophisticated capabilities to interpret
face. I suggest normally using standard face, varying only color (w i t h b a s i c 1 6 c o l o r s) and size. Size can be absolute
(from 1 to 7) or relative to the original font
(+1, -2, etc..) Headings should be indicated
by the heading tag not with larger font because mapping can be done with headers.
Examples of Basic Logical Highlighting
- CODE - This is
typed computer code text
- EM - This is emphasized text
- KBD - This is keyboard input text
- STRIKE - This is a
strike-out text
- STRONG - This is a strongly emphasized text
Examples of Basic Character Highlighting
- B - This is boldfaced text
- BIG - This is bigger text
- I - This is italicized text
- S - This is
strike-through text
- SMALL - This is smaller text
- SUB - This is sub script text
- SUP - This is super script text
- TT - This is fixed-width typewriter font text
- U - This is underlined text
Basic Tag HTML
Container tags (need a beginning and ending tag)
- <H1></H1>Headlines numbers go from 1-6, largest to smallest.
- <P></P>Paragraphs
- <UL> Begin Unordered list (bulleted){possible attributes:
TYPE=DISC/CIRCLE/SQUARE>}
<LI> {item to be listed}
</UL> End Unordered list
- <OL> Begin Ordered list
<LI>< {item to be listed}
</OL> End Ordered list
- <DL> Begin Definition list
<DT> {item to be listed; definition term}
<DD> {definition of item, indented}
</DT> End Definition list
- <BLOCKQUOTE></BLOCKQUOTE>Block quotes
Examples of Basic Logical Highlighting HTML:
- CODE - This is <CODE> typed computer code</CODE> text
- EM - This is <EM> emphasized </EM> text
- KBD - This is <KBD> keyboard input </KBD> text
- STRIKE - This is a <STRIKE> strike-out</STRIKE> text
- STRONG - This is a <STRONG> strongly emphasized</STRONG> text
Examples of Basic Character Highlighting:
- B - This is <B> boldfaced </B>text
- BIG - This is <BIG>bigger </BIG>text
- I - This is <I> italicized </I> text
- S - This is <S> strike-through</S> text
- SMALL - This is <SMALL> smaller </SMALL>text
- SUB - This is sub <SUB>script </SUB>text
- SUP - This is super <SUP>script </SUP>text
- TT - This is <TT>fixed-width typewriter font</TT> text
- U - This is <U>underlined</U> text
Non-container tags {no end tag needed}
- <HR>Hard rule
- <BR>Line break
|
[Top]
Link Basics
The beauty of authoring on the Web is that you can connect internal documents by
linking them and you can integrate others work on the Web by linking to outside sites.
Hypertext is the text that is associated with a link.
Basically, a link is a container tag with the referenced text contained inside. Links
are composed of an "anchor tag" and an "end tag".
Look at the following link:
<A HREF="document.html">Go to document</A>
The <A> stands for "anchor" and starts the hypertext. The </A>
ends the anchor and the hypertext. HREF stands for Hypertext Reference.
Note that HREF is followed by an equal sign and the name of an HTML file or URL address in
quotations. When you are linking to a document saved in the same location as the document
you are jumping from you need only include the html filename (="xxx.html"),
HOWEVER, if you are jumping outside to an external site you must include the full URL
address(="http://www.cce.iastate.edu").
Links can be used to jump from one point in an internal document to another. The
hypertext links at the top of this document are an example of internal links. There are
two parts to an internal link - the starting point (where you jump from) to the
destination (where you jump to). See below:
<A HREF="#gohere">starting point</A>
<A NAME="gohere">destination point </A>
Try it! Go here *Come back*
An anchor tag with a mailto attribute can be used to gather feedback or can be used to
send a completed form. See below:
<A HREF="mailto:youremail@iastate.edu">Select this to
send mail youremail</A>
dslutz@iastate.edu
[Top]
Basic Graphics
To insert an image in your HTML document you will have to use an image tag. An image
tag consists of the tag IMG SRC followed by the name of the image file in quotations. The
following is the HTML for the accompanying gif image.
<IMG SRC="globe1.gif"> Any text that comes after
will be placed at the bottom left unless you use align attributes or breaks.
<IMG SRC="earth2.gif" align=top>
Starts the text at the top and the overflow goes to the end of
the image. This often looks rather bad, leading to chunky design.
To avoid this use a break clear all (<br clear=all>) so
that the text will all be placed to the left of the image.
<IMG SRC="earth2.gif" align=left>text block <br clear=all>
<Br clear=all> clears both margins. You can also use a <BR clear=right> or
<BR clear=left> to clear either margin.
Image labels, using alternative tags
It is best to label your graphic images so that those who do not have graphic
capability will know what the image is and what size. Some users will turn graphic loading
off and only load images that they really want to see.

<IMG SRC="file.gif" ALT="This is gif image of the earth 22 x
40">
Images as Links
Images can also be used as links, so that if a person clicks on a linked image they are
moved to either an internal or external link. 
<A HREF="bigleo.jpg">
<IMG SRC="smleo.gif" ALIGN=LEFT ALT="This is a thumbnail of a leopard
frog, 16KB."></A>
The bigger jpeg image is 53K and takes about 30 seconds to load over a 14.4 modem. The
small image is only 15K and takes only about 3 seconds to load.
Please remember to use graphics only when they add content to your website. You have to
balance the time it takes to load an image with any advantage the image lends to the site.
|
[Top]
Basic Tables
Tables can be used in websites for layout design (as in this site) and to organize
information. Tables can be embedded in tables which allows there use for layout design
which appears similar to frames. Here are the basic tags needed to define a table:
<TABLE> Begins a table
<TR>Defines a table row
<TD>Defines table data (a cell)
</TD>Ends the table data
</TR>Ends the table row
</TABLE>Ends the Table
The look of the table can be changed with border, column spanning, cell spacing and
cell padding attributes. Here is a short table demonstrating these attributes.
< TABLE> border=2 cellspacing=10 cellpadding=5
<TR>
<TD colspan=3>Table example
</TD>Cell 1
</TD>Cell 2
</TD>Cell 3
</TR>
</TABLE>
| Table example |
| Cell 1 |
Cell 2 |
Cell 3 |
Here is a link to a more complex
table that contains images. Look at this style sheet to see how tables can be used for
layout.
[Top]
Basic Forms
Here is an example of a simple form. Go ahead and try it out and send me your comments.
This is the code for the above example:
Name: <INPUT TYPE="text" NAME="name" VALUE=""
SIZE=30>
Email address:<INPUT TYPE="text" NAME="name" SIZE=30>
Question: Please send me comments about this HTML primer<TEXTAREA
NAME="name" ROWS=10 COLS=40> </TEXTAREA>
<INPUT TYPE="submit" Value="Push to test"> <INPUT
TYPE="reset" Value="Clear form">
You can use text boxes in forms, as above, you can use radio buttons (which only allow
one response), check boxes (that allow a user to check all that apply) and you can supply
lists of options for the user to select one. All of these form attributes are shown in
this example. You can do a view source at this page to see
the code. This form requires a cgi script on your host server. I am using a umass server
now, but willing be updating this form cgi soon. |
[Top]
A Basic Image Map
I wanted to say just a little about client side image maps as some of you may want to
use an image map for a navigation bar. Just remember that images in the image bar will
take time to load so make them simple images!
First you will need to develop a meaningful image with definable sections. Second, you
will need to map this image and discover the coordinates for the sections. You will need
to have an image editor that has these capabilities. I have WebImage and can map your
image for you if needed. Or go to the Poor person's image map http://www.pangloss.com/seidel/ClrHlpr/imagemap.html
and make one for yourself in two minutes.
Here is an example of an image map for this site. I know it's not much, but hey, it's
just an example.
And here is the code for the image map.
<IMG SRC="Map1.gif" USEMAP="#Map" BORDER=0 WIDTH=371
HEIGHT=56>
<!-- Start of Client Side Image Map information -->
< AP NAME="Map">
<AREA SHAPE=RECT COORDS="7,3,97,21" HREF="#HTML">"
ALT="">
<AREA SHAPE=RECT COORDS="110,3,156,21" HREF="#Links"
ALT="">
<AREA SHAPE=RECT COORDS="167,3,232,21" HREF="#Graphics"
ALT="">
<AREA SHAPE=RECT COORDS="242,3,302,21" HREF="#Tables"
ALT="">
<AREA SHAPE=RECT COORDS="321,3,365,21" HREF="#Forms"
ALT="">
<AREA SHAPE=RECT COORDS="66,38 149,55" HREF="#Map"
ALT="">
<AREA SHAPE=RECT COORDS="167,38 228,55" HREF="#Frames"
ALT="">
< AREA SHAPE=RECT COORDS="247,38 333,55" HREF="#Refer"
ALT="">
</MAP>
[Top]
Basic Frames I don't have much to say about
frames. Personally, I don't like them. If you want to see how frames work go to this style sheet and this
example
site and view the codes. Basically, you have one html document that tells the segment
(frames) documents where to go into the master site.
|
[Top]
References:
Graham, I.S. 1997. HTML Sourcebook: The complete guide to HTML 3.2 and HTML extensions.
Wiley Computer Publishing. New York. {available for checkout from my office}
U Mass Dartmouth CyberEd's WEBCRAFT
Yale's Style Manual
NCSA's A
Beginner's Guide to HTML
A Beginner's Guide to URLS
Destination *jump back*
` Webmaster: Donna S. Lutz
Last Update December 4, 1997
|