MORE HTML CODES |
Back |
The HyperText Markup Language (HTML) is composed of a set of elements
that define a document and guide its display.
This document presents a concise reference guide to HTML,
listing the most commonly used elements from Versions 1 and 2 of HTML,
and giving a brief description of those elements.
Users should be aware that HTML is an evolving language, and
different World-Wide Web browsers may recognize slightly different sets of
HTML elements.
For general information about HTML including plans for new versions, see
http://www.w3.org/hypertext/WWW/MarkUp/MarkUp.html.
For a comprehensive list of HTML elements see
http://www.sandia.gov/sci_compute/html_ref.html
This document is available in two formats:
An HTML element may include a name, some attributes and some
text or hypertext, and will appear in an HTML document as
<tag_name> text </tag_name>
<tag_name attribute_name=argument>
text </tag_name>
, or just<tag_name>
For example:
<title> My Useful Document </title>
and
<a href="argument"> text </a>
An HTML document is composed of a single element:
<html>
. . . </html>
that is, in turn, composed of head and body elements:
<head>
. . . </head>
and
<body>
. . . </body>
To allow older HTML documents to remain readable, <html>
,
<head>
, and <body>
are actually
optional within HTML documents.
<isindex>
<title>
. . . </title>
<base href="URL">
<link rev="RELATIONSHIP"
rel="RELATIONSHIP" href="URL">
rel
attribute specifies therev
attribute (for "reverse")<link rev="made" href="URL">
The following sections describe elements that can be used
in the body of the document.
<p>
<pre>
. . . </pre>
<pre>
tag can be used to include tables in<listing>
. . . </listing>
<xmp>
. . . </xmp>
<pre>
except no embedded tags will<plaintext>
<pre>
except no embedded tags will</plaintext>
<blockquote>
. . . </blockquote>
<a name="anchor_name">
. . . </a>
<a href="#anchor_name">
. . . </a>
<a href="URL">
. . . </a>
<a href="URL#anchor_name">
. . . </a>
<a href="URL?search_word+search_word">
. . .</a>
An anchor must include a name
or href
attribute,
and may include both. There are several optional attributes, but they
are rarely encountered.
The structure of a Uniform Resource Locator (URL) may be expressed as:
where the possible resource types include: file
,
http
, news
, gopher
,
telnet
, ftp
,
and wais
, among others, and each resource type relates to
a specific server type. Since each server performs a unique function,
each resource type requires different additional_information
.
For example http
and gopher
URLs will
have a structure like:
The colon followed by an integer TCP port
number is optional, and is used when a server is listening on a
non-standard port.
Strictly speaking, the anchor_name
and
search_word
information included
in the name
and
href
attributes in the examples above are part of the URL.
They are presented as separate entities for simplicity.
A more complete description of URLs is presented
in
http://www.w3.org/hypertext/WWW/Addressing/Addressing.html
<h1>
. . . </h1>
Most prominent header<h2>
. . . </h2>
<h3>
. . . </h3>
<h4>
. . . </h4>
<h5>
. . . </h5>
<h6>
. . . </h6>
Least prominent header
<em>
. . . </em>
<strong>
. . . </strong>
<code>
. . . </code>
<samp>
. . . </samp>
<kbd>
. . . </kbd>
<var>
. . . </var>
<dfn>
. . . </dfn>
<cite>
. . . </cite>
<b>
. . . </b>
<i>
. . . </i>
<u>
. . . </u>
<tt>
. . . </tt>
<dl>
<dt>
First term to be defined<dd>
Definition of first term<dt>
Next term to be defined<dd>
Next definition</dl>
The <dl>
attribute compact
can be used to
generate a definition list requiring less space.
<ul>
<li>
First item in the list<li>
Next item in the list</ul>
<ol>
<li>
First item in the list<li>
Next item in the list</ol>
<menu>
<li>
First item in the menu<li>
Next item</menu>
<dir>
<li>
First item in the list<li>
Second item in the list<li>
Next item in the list</dir>
Items should be less than 20 characters long.
&
keyword;
&
specifies the <
specifies the less than &#
ascii_equivalent;
The HTML forms interface allows document creators to define HTML
documents containing forms to be filled out by users.
When a user fills out the form and presses a button indicating the
form should be "submitted," the information on the form is sent to
a server for processing. The server will usually prepare an HTML
document using the information supplied by the user and return it to
the client for display.
The following tags implement the forms interface:
<form>
. . . </form>
<input>
<select>
. . . </select>
<option>
<textarea>
. . . </textarea>
The last four tags can only be used within a
<form>
. . . </form>
element.
<form>
. . . </form>
Defines a form within an HTML document.
A document may contain multiple <form>
elements, but
<form>
elements may not be nested.
Note that non-form tags can be used within a <form>
element.
Attributes and their arguments:
action="URL"
: method=data_exchange method
get
or post
. post
is preferred for most applications.
<form action="http://www.cc.ukans.edu/cgi-bin/register"
method=post>
. . . </form>
<input>
(there is no ending tag)
Defines an input field where the user may enter information on the form.
Each input field assigns a value to a variable which has a specified
name
and a specified data type
.
Attributes and their arguments:
type="variable_type"
type="text"
and type="password"
fields type="checkbox"
fields are either selected
or nottype="radio"
fields of the same name allow
selection type="submit"
defines an action button that
sends type="reset"
defines a button that resets
the form type="hidden"
defines an invisible input
field whose valuetype="image"
defines an image map within a
form and
name="textstring"
textstring
is a symbolic input
variable as in:<input type="checkbox" name="box1">
value="textstring"
textstring
type
.
type="text"
or type="password"
,textstring
is the default value for the input
variable. Password values will not be shown on thetype="checkbox"
or type="radio"
,textstring
is the value that will be sent to the server type="reset"
or type="submit"
,textstring
submit
" and "reset
".
checked
type="checkbox"
type="radio"
, checked
is present the input
field size="display_width"
display_width
is an integer value type="text"
type="password" input
field.maxlength="string_length"
string_length
is the maximum number of
characters type="text"
or type="password"
"text"
"password"
fields.
<select>
. . . </select>
Defines and displays a set of optional list items from which the user
can select one or more items.
This element requires an <option>
element for each
item in the list.
Attributes and their arguments:
name="textstring"
textstring
is the select
field variable.size="list_length"
list_length
is an integer value representing <option>
items that will be multiple
multiple
attribute <option>
value.
<option>
Within the <select>
element the <option>
tags are used to define the possible values for the select
field. If the attribute selected
is present then the
option
value is selected by default. In the following example
all three options may be chosen but bananas are selected by default.
<select multiple>
<option>Apples
<option selected>Bananas
<option>Cherries
</select>
<textarea>
. . . default text . . . </textarea>
Defines a rectangular field where the user may enter text data.
If "default text" is present it will be displayed when the field
appears. Otherwise the field will be blank.
Attributes and their values:
name="textstring"
textstring
is a symbolic <textarea>
variable.rows="num_rows"
and cols="numcols"
<textarea>
<!--
text -->
<address>
. . . </address>
<img src="URL" alt="Alternate
Text">
src
alt
align
align
can be one of top
,middle
, or bottom
. ismap
ismap
is present and the image tag is within
<br>
<hr>