LEARNING MODULE
III
BASIC HTML/XHTML
AUTHORING
FOR "TWEAKERS"
This
learning module is an introduction to HTML and its successor, XHTML,
from a practicioner's point of view. It is the first of a two module
presentations of HTML; in this LM III we consider basic page
layout and in LM IV we cover complex pages that contain tables,
frames, forms, and other components. Instead of presenting HTML as
a programming language with which to code HTML programs, we will consider
HTML/XHTML as a collection of resources with which we can generate HTML
documents. For the sake of efficiency, whenever possible, I advocate
the use of WYSIWYG HTML authoring tools to prototype HTML documents,only
resorting to coding tools can not accomplish the desired effect.
This approach conforms to Tim Berners-Lea's vision of HTML as enunciated
in his interview
on ZDTV's Big Thinkers.
Note
that the concise, tabulated presentation of HTML tags in the LM is intended
to be an alternative to that of the textbook and Web references that complements
those formats. (See the Study Guide
for this learning module.) Tell me what you think.
The Objectives of this learning module are to:
This
LM follows the sequence of chapthers in Niederst, Web Design in a Nutshell,
but edits out older, deprecated tags as well as most of those tags that
are browser dependent. The sequence of presentations in this learning
module is as follows. You can click on any link to jump directly
to that section.
HTML's primary purpose was to give the user ultimate control a Web presentation, a unique characteristic of Web documents. The language itself is a special case of class of programming languages called "markup languages" which consist of "tags" which are used to "mark up" the text with instructions to a browser about how to display the document and insert multimedia into it. To understand HTML it is important to survey the properties of markup languages in general and examine the basic properties of other markup languages.The most frequently used tags can be inserted using a WYSIWYG authoring tool, however the tags that can be automatically inserted (using menus and dialog boxes) depends not only on the authoring tool but also on the type of Browser (e.g. Netscape Navigator or Internet Explorer) but also on the version of the particular browser. This browser/version dependency combined with the fact that many tags are not automatically inserted by authoring tools makes it advisable for Web developers to be familiar with all HTML tags and be able to quickly look up the syntax for inserting such tags into their documents.
1. OVERVIEW OF MARKUP LANGUAGES:
Markup languages are very high level ( VHLL) authoring systems that allow developers to "mark up" text with tags that format it, incorporate multimedia into it, and create hyperlinks in it. The most commonly known example is HTML, in which this learning module is written, but it is being superceded by newer more sophisticated languages.
2.1 HTML Authoring Tools:
2.2 Basic HTML Document Structure:
|
|
|
|
| <base>...
</base> |
href=url;
specifies
the URL to be used
target=name; specifies default target window |
located within the head
specifies base URL for all relative URLs in the document |
| <body>...
</body> |
alink="#rrggbb" or
color
name
background=url bgcolor="#rrggbb" or color name link="#rrggbb" or color name text="#rrggbb" or color name vlink="#rrggbb" or color name; color of visited links |
defines the limits of the
document body, i.e. the content displayed in a browser.
Attributes affect the entire document. |
| <head>...
</head> |
serves only as a container for other header tags | |
| <html>...
</html> |
serves only as a container for all the HTML document | |
| <link> | href=url;
specifies
the target document
methods=list; uncommon; specifies list of display methods rev=relation; specifies target to source relationship rel=relation; specifies source to target relationship rel=stylesheet; specifies external stylesheet used title=text; specifies title of target document type=resource; specifies type of outside link, e.g. CCS urn=urn; specifies Universal Resource Name |
located within the head
defines link to external document, often a stylesheet |
| <meta> | hcontent=text;
specifies
value of meta tag
http-equiv=text; specifies info for HTTP header name=text; specifies the name of meta info scheme=text; info for interpretation of meta data |
located within the head
provides automatic or developer definable info about document typically used to provide keywords to help search engines recognize contents |
| <title>...
</title> |
specifies document title,
shown in the top bar of a browser window
In XHTML <title> must be the first element in <head> |
SAQ
8: What is the important similarity between <html>, <head>, and <body>
tags?
4.
FORMATTING TEXT (
See
Niederst,
Chap. 7.):
|
|
|
|
| <address>...
</address> |
specifies ownership or authorship | |
| <blockquote>..
</blockquote> |
specifies that the enclosed text is indented from
both right and left
|
|
| <div>...
</div> |
align=center|left|right | delimits a division of a page; especially useful with stylesheets |
| <hn>...</hn>
where n =1 to 6 |
align=center|left|right | specifies enclosed text is one of six heading styles where 1 is largest |
| <p>...</p> | align=center|left|right | delimits a paragraph |
|
|
|
|
| <abbr>...
</abbr> |
title=string | specifies inclosed text is an abbreviation
can be used as an element selector in a style sheet |
| <acronym>..
</acronym> |
title=string | specifies inclosed text is an acronym
can be used as an element selector in a style sheet |
| <b>...</b> | delimits bold text | |
| <basefont> | color
(not standard)
face (not standard) size=value |
specifies style of all subsequent text |
| <big>...
</big> |
||
| <blink>...
</blink> |
||
| <cite>...
</cite> |
delimits citation, usually displayed as italic | |
| <code>...
</code> |
delimits programming code sample, usually displayed as courier | |
| <del>...
</del> |
specifies deleted text; usually used to hide it | |
| <em>...
</em> |
delimits emphasized text, usually displayed as italic | |
| <font>...
</font> |
color="#rrggbb"
face=stypeface (or list of typefaces) size=value |
|
| <i>...</i> | delimits italic text | |
| <ins>...
</ins> |
delimits inserted text | |
| <kbd>...
</kbd> |
delimits text typed on keyboard, usually displayed as courier | |
| <q>...</q> | cite=url | delimits short, inline quote, usually displayed within quotation marks |
| <s>...</s> | delimits stirkethrough text, same as <strike> | |
| <samp>...
</samp> |
delimits samples of something, usually displayed as courier | |
| <small>...
</small> |
||
| <span>...
</span> |
a null text container designated a span of inline
characters
used with style sheets |
|
| <strike>...
</strike> |
||
| <strong>...
</strong> |
||
| <sub>...
<sub> |
||
| <sup>...
</sup> |
||
| <tt>...
</tt> |
delimits typewritter text, usually displayed as courier | |
| <u>...</u> | delimits underlined text | |
| <var>...
</var> |
delimits an instance of a variable text, usually displayed as italic |
|
|
|
|
| <br> | clear=all|left|right | line break |
| <center>...
</center> |
||
| <nobr>...
</nobr> |
delimits text to be displayed on one line | |
| <pre>...
</pre> |
width=value | delimits preformatted text, displayed as typed,
including multiple blanks
usually displayed as courier |
| <wbr> | specifies, within <nobr>...</nobr>, potential word break point |
|
|
|
|
| <dl>...
</dl> |
compact (rare browser support) | specifies definition list
consists of terms, <dt>, and definitions, <dd>. |
| <dd>...
</dd> |
delimits definitions within <dl> | |
| <dt>...
</dt> |
delimits terms within <dl> | |
| <li>...
</li> |
type=format
value=number |
specifies a list item; used within <dir>, <ol>, and <ul> |
| <ol>...
</ol> |
compact
(rare browser support)
start=number (starts list at number.) type=1|A|a|I|i (deprecated in HTML 4.O) |
The type attribute is superceded by style sheets controls in HTML 4.0. |
| <ul>...
</ul> |
compact
(rare browser support)
type=disc|circle|square |
5.
CREATING LINKS (
See
Niederst,
Chap. 8.):
|
|
|
|
|
| <a>...</a> | href=url
method=value (typically an application; rarely used) name=text title=text target=text (frame in which page is displayed)
|
Defines an "anchor" used to link to another location in any Web document. | |
| <area> | coords=values (comma
delimited pixel coordinates)
href=url nohref shape=rec|rectangle|circ|circle|poly|polygon |
Used within the <map> tag to define a "hot" area of a client-side imagemap | |
| <map>...
</map> |
name=text | encapsulates client-side imagemap specifications |