Summary of HTML Elements

This is a summary of the HTML <tags> or more formally, ‘elements’.   Examples follow below. First a brief explanation of markup, tags and attributes together with stylesheets and their properties.

The standards we use for computer text today were built on those used for telegraphs

Markup is needed because computer text files can contain little more than the typeable characters. Plain text has no character code to mean bold, heading, paragraph or list and there is no way to specify actions like a link to another file. The markup tags in HTML provide a standard way for text to specify this sort of thing.

Markup is added to text by surrounding it with tags.   The start tag is the less than sign < and the greater than sign > is the end tag. So if the phrase <markup> were to appear in an html file the word ‘markup’ would not appear on the screen; instead the browser evaluates it as a control word. Since the word ‘markup’ isn't normally used for control purposes it would actually be ignored and not printed .

Most markup is intended to apply to a selected portion of text, which might range from a single letter to a paragraph, page or the whole document. Tags are used in pairs so that <b> bold </b> tells the browser to make the word(s) enclosed by the tags bold.   The start tag <b> turns bold on and the end tag </b> turns it back off again.

HTML started as a small, practical language for scientific documentation in CERN around 1990. A lot of people had been looking for a practical way to interlink documents in an non-proprietray way. It quickly caught on, but has changed a bit. At one time "tags" were uppercase, they should now all be lowercase. Most browsers (sometimes called "visual user agents") will accept either. Things often have a fancy name like “visual user agent” as well as a common one like “browser”   “element” and “tag” are another example.

The first draft spec “HTML Tags” was about 6 sides of print and suggested fewer than 20 markup tags. The tags were used to indicate the structure of a document; breaking it down into headings, paragraphs and lists. The browser (or a print routine) would then use the structure to determine how to present things. So a heading <h1> might be in larger and heavier type depending on its importance, a paragraph <p> would form a block and a list <li> would be a block with list-items bullet-pointed on individual lines. However there were no enforceable standards and other people added tags for bold, underline, centered text, colours, fonts, tables and images - things that are often more concerned with a documents presentation rather than it's structure. There are now over 100 tags although many are rarely used and some are deprecated, meaning they may no longer work in future.

The look of a document and its structure are no longer necessarily connected but there are strong arguments that they should be. A stylesheet then controls any presentation beyond the browser defaults. The type of stylesheet used is generally a “CSS” file.   Use of both HTML and CSS is initially more complicated because a page is made from two rather different languages and two files. There are considerable benefits to CSS, though. For instance:

  • Repeated markup can be eliminated. Font and colour are reiterated many times in non CSS markup.
  • The look of a document can be rather dull at first but it can be transformed by changes to the CSS.
  • Stylesheets fit in with the way the world often works. One group of people write content, another group are responsible for presentation.
  • Furthermore there can be just a few CSS files controlling the look of an entire site, so changing them can give a radical overhaul to thousands of pages .

In the paragraphs above it is suggested that <markup> would not appear on the screen but be evaluated as a control word. The trick used to make it appear here is to use HTML special characters (“ character entity references ”) which get presented as the less than and greater than signs but are written quite differently as &lt; and &gt;. HTML is full of tricks like this.   If you want to know how they work look at the source-code for the page.

This list of HTML tags has been compiled for MindMachine internal use. It is not a definitve reference work - merely notes. The W3C publications such as the HTML 4.01 specification are the definitive references. The disadvantage with the W3Cs definitive work is that the HTML 4.01 spec runs to 389 pages long - whilst this is under 40 pages long.   This file can also be edited to meet local needs.

For information on measurements see W3C Cascading Style Sheets CSS2.1 sect 4.3.2

Wikipedia also maintains a good list of tags at the page   Html_tags.  As usual there is a caution that Wikipedia can be right one day, wrong the next. It is quite possible for this document to be wrong as well.


Main Elements:

<html> ... </html>Wraps the whole head and body of the page. Tells the software handling the page (a browser) that the page is html and not just text for instance. An alternative could be <xml>. There is normally a <!DOCTYPE ... > as well but it isn't always essential.
<head> ... </head>Identifies the header of a document  containing meta-information such as the title, author and stylesheet. Header information helps set up the browser and provides contextual information but it is not actually displayed on the web-page.
<title>  ... </title>Gives a title for the page usually displayed in the title bar.
<base>Specify a base URL from which to build all other relative URLS.
<body> ... </body>Wraps the main body of the page containing the tags and text.
<hn> ... </hn>Heading h1, h2 ... to ... h6. A document might start with an <h1>, have main arguments arranged under <h2> and sub argument headers under <h3> etc.
<p> ... </p>Create a paragraph, ie a block of text. Most textual documents are made up from a succession of paragraphs
<ul><li>...</li>... </ul>Create a list. <ul> announces the list and <li> announces each element in it. ul is an unordered list, it has bullet-points rather than numbers. ol makes an ordered list with numbered points. Can be nested, so a list can contain others.
<table> <tr><td>...</td>...</tr>... </table>Table with rows and cells. <table> announces the table. <tr> makes a row and <td> a division in the row.
<div> ... </div>Division. Creates a block within a document with no other effect except a line break. Normally used with CSS using descendant selectors.
<span> ... </span>Span. Creates an inline division in a document with no other effect. Normally used with CSS using descendant selectors.
<br />Break the line and force a vertical space. Resume the text on the next line. Although a couple of <br/> elements at the end of text gives the look of paragraphing it is better to use <p> if that is the intention
<hr />Horizontal Rule. A line across the page. Implies some sort of break in the structure, for instance a chapter end.
<a> ... </a>Anchor. Create either a named anchor-point in the document as a place for links to go to, or an href hyperlink from this point to another in this document or anywhere on the web.
<img>Insert an image in the current text flow.
<object> ... </object>Embedded objects such as images or movies requiring a helper application.

Presentational Elements:

Web pages or ‘ hypertext ’ are entirely made up of text.   One part of the text behaves just like text in any other document, it displays on the screen. The <hypertext> enclosed in less than and greater than signs is not normally visible in a browser and specifies presentation, links and images.   There are no images, objects or links in an HTML file,   just text specifying where those things are.

Much of the text is like that from any plain-text file, it gets presented literally, so the character ‘X’ prints in the browser window more or less as it is in the HTML source. There is a difference, though. If nothing else is said the character will just print in whatever default style the browser provides. However in HTML we can also change the presentation by specifying a style or font.   So for instance X might be presented as X, X, X or X.

The different presentations of ‘X’ shown there were done with:

<b>X</b>, <u>X</u>, <i>X</i>, <b><u><i>X</i></u></b>

Notice that the last X has a succession of three elements applied and then closed, it is preferable (if not compulsory) to nest the closure of things last in-first out as above.

<b> ... </b>Bold
<i> ... </i>Italic
<u> ... </u>Underline
<big> ... </big>Bigger
<small> ... </small>Smaller
<sup> ... </sup>Superscript
<sub> ... </sub>Subscript
<strike> ...</strike>Strikethrough
<tt> ... </tt>Typed Text (Monospace)

Presentational elements are often deprecated because they don't seem to contribute "structure" to a document.   There is a problem here. Structure is not always self evident to an author, sometimes it is emergent.   So a markup is useful for the stage where we feel a word might sensibly be emboldened but are not yet sure whether it is a heading of some kind or perhaps it should be shown by some sort of id on a span.

For instance, the phrase often used in material aiming for W3C conformance is

<span style="font-weight: bold;">Note</span>

it is much more complicated than

<b>Note</b>

Having a notation to say This needs bolding is helpful.

The <b> for bold presentational element is handy and quick to use, and has a sort of meaning as an inline heading. The others are more dubious, for instance underline is often used for links and might confuse users.

A couple of other elements that have an impact on the font are
<basefont>Specify the font size
<bdo>Bidirectional Override
this section needs expanding

Font Elements:

There is a font element.   First a warning.

The font tag is deprecated because almost everything it can achieve would be better done using stylesheets and the HTML structural elements such as the phrase-elements below ( <h1>, <q>)   - or if necessary the presentational elements ( <b>, <tt>) above. So if you are experiencing an urge to say “ font ” in html try to use one of the phrase elements such as a heading:

<h3>A Heading</h3>

The <h3> type of tag provides markup of the structure rather than just specifying a font.   It has the advantage that the font, colour and size can be uniformly changed throughout the page and indeed throughout a site by one change to a stylesheet.   Headers have a range <h1> to <h6>  .   The headers do have a disadvantage, they don't act inline - i.e.they normally force an effective paragraph break.

A possible alternative is one of the presentational elements such as <b> for bold

Supposing something bigger, smaller or just not a header is wanted and just once so the specification should be right next to the literal text,   try inline style:

<span style="font-weight: bold;">Font Elements:</span>
or
<p style="font-weight: bold;">Font Elements:</p>

... End of the warning

Font elements are another way to specify how text is to be presented.   Specifying font directly like this is easy, but it is often frowned on because unless the the change of font is a one-off it becomes inefficient.

< font size="+1"; face="serif"; color="#8cacdf" > Font Elements: < /font >

results in:

Font Elements:

which looks pretty much like a heading.

The font elements often prove handy in simple single pages. If there are a collection of pages it is better to avoid them and use structural and phrase elements together with CSS.


<font> ... </font>specify attributes such as face, size or color.


Phrase Elements:

Using the phrase elements provides some measure of "semantic markup", particularly when combined with the "class=" and "id=" attributes

<h1...6> ... </h1...6>Header (1 ... 6) where h1 is most important and h6 least.
<strong> ... </strong>Make the print stronger (suggested to be better than <b>).
<em> ... </em>Emphasised (usually italic).
<cite> ... </cite>Enclosed text is a citation; a reference for a quote or statement in a document.
<code> ... </code>The enclosed text is a code sample.
<dfn> ... </dfn>The enclosed text as a definition.
<abbr> ... </abbr>Indicates an abbreviated form.
<acronym ... </acronym>Indicates an acronym.
<samp> ... </samp>Indicates sample output from a program.
<kbd> ... </kbd>Indicates text to be entered by the user.
<var>... </var>Indicates a varaible or program argument.
<blockquote>  ... </blockquote>Usually a larger block giving left and right indentation of enclosed text.
<q> ... </q>Usually for short quotations that don't contain paragraph breaks
<address> ... </address> Format as an address.
<pre> ... </pre>Allows inclusion of pre-formatted text. If the text overflows there is no automatic wordwrap.
<center> ... </center>Display the enclosed text centre justified.
<bdo> ... </bdo>Directional override - text reading direction opposite to parent element.
<hr>Horizontal Rule. Break the text and insert a line.

Lists & Tables

Unordered Lists and Ordered Lists provide "Bullet Points"

<ul>
<li> List element1 <\li>
<li> List element2 <\li>
...
</ul>
Unordered List - normally bullet point elements. Looks like this in practice:
  • List element1
  • List element2
<ol>
<li> List element1 </li>
<li> List element2 </li>
..
</ol>
Ordered List - normally an ascending list of numbered elements. Looks like this in practice:
  1. List element1
  2. List element2

Definition Lists alternate left justified and indented lines - as might happen in a dictionary.

<dl>
<dt> Left Justified Element
<dl> Indented Point
<dl> Indented Point
<dt> Left Justified Element
<dl> Indented Point
<dl> Indented Point
</dl>
Definition List. A list of text elements with definition lines. Looks like this in practice:
A first left justified Definition Term
An indented Definition Line of the 1st Term
Another indented Definition Line for the 1st Term
A second left justified Definition Term
The first indented Definition Line of the 2nd Term
Another indented Definition Line for the 2nd Term

Tables are (ab)used more than any other construct to get page layouts

<table>
<tr> table row
<td> table data</TD>
<td> more table data</TD>
...
</tr>
<tr> ...</TR>
...
</table>
Table
table row 1 data 1table row 1 data 2
table row 2 data 1table row 2 data 2

We can also put <tbody> around the table - see the code for this page.

Tables are primarily intended for organising associations of information.   A grid-like divsion of space can be used as a principle for general page layout.   Many web-pages use tables as nothing more than a layout device. Tables tend to be quite stable as layout devices across a variety of browsers and screen sizes.

Ins & Del

"ins" and "del" are intended to mark up the revisions of a document.

<ins> ... </ins> Things marked ins should be highlighted in some way.
<del> ... </del> things marked “ del ” should appear with a strikeout for instance del


 
<area> ... </area> Client-side image map area.
<map> ... </map>
<bgsound>Define background audio for the document.

 

Scripts

<script> ... <script>Holds a script in a page.
<noscript> ... <noscript>Replacement content for scripts. (block level only)

Practical Examples

A basic HTML page does little more than declare itself open with the <html> tag;   declare a <header>, <title>, <body> and then close in an orderly fashion.

Minimally

A minimum page looks like this:

<html> <head> <title>Some Title</title> </head> <body> elements - sometimes called "tags" and text. More tags and text. </body> </html>

The <!DOCTYPE>

The doctype is an instruction to the system on how to read the rest of the page. Specifically it specifies the Document Type Definition (DTD) that this particular document is supposed to conform to.

For SGML and XML a Document Type Declaration is important, it specifies the structure of the language to come and there will be a formal definition file that can be referenced

HTML does not necessarily need a DOCTYPE but new browsers intended primarily for HTML5 may perform better if it is present, if it is absent the browswer may use “ quirks mode ” to render the document in the same ways as older browsers which sometimes did odd things. In practice most pages and browsers work without it, most of the time. The page can say as little as:

<!DOCTYPE html>


Header

Headers look like this:

<!doctype html public "-//w3c//dtd html4.0 transitional//en">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="Cedric Gophersof">
<meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; I) [Netscape]">
<title>HTML</title>
</head>

 

An alternative header looks like this:

<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title>HP Color LaserJet CP3505</title>
<link rel="stylesheet" href="//mindmachine.co.uk/products/research.css" type="text/css" media="screen">
<meta content="Text Created by Graham Huskinson Copyright 2009 Pictures Copright HP" name="author">
<meta content="Description and Specification for the HP Color LaserJet CP3505" name="description">
<meta content="CLJ CP3505">
</head>


<head>...</head>

The header tags surround the title, metas and any header style rules. Headers are not visible in the page although the title is likely to be displayed at the top of the browser window


<head>
  ...
</head>

<title>  ... </title>

The title to appear in the page header or window title bar. Since users and user-agents may use titles out of context W3C suggests titles be context-rich "Introduction to Medieval Bee-Keeping" rather than just "Introduction". Unfortunately some browsers crowd the title bar with both the filename, title and browser name and then neither displays correctly. However a 5 or 6 word title is normally sufficient without being burdensome. If there really is a lot to say put it in the <meta> lines.

<title>  ... </title>

<meta content="..." name="...">

The meta content lines are primarily aimed at search engines and recording information we want coding up in some way but not showing on the page


<style>...</style>

<style type="text/css"> /*Add style rules */ hr.subdivision {color:blue; size:3px; width:80px} p{color:#0030AA} h3.html {font-size:14pt; font-family:monospace; } p.html {font-size: 10pt; font-family:monospace; margin-left:5em; color:#000099;} p.attribute {font-size: 10pt; font-family:monospace; margin-left:8em; color:#990099; } </style>

Style for a page can be supplied by an external stylesheet using the <link> tag in the header. Usually having one or more external stylesheets will be most convenient as the stylesheets can then apply to the entire site.

Style can also be provided in the header of a file as shown here. This is convenient if a set of rules apply only to one or two pages.


<body> ... </body>

Delimit the beginning and end of a document body which contains the material that will be displayed on the web page. Things are either in the body or in the <head> elements.

Traditionally the body of a document would be a good place to choose a font, it's size and colour and to set things like the margins and background colours. Browsers do allow this, however the the standards bodies deprecate the idea in favour of extablishing these things using CSS.   For instance style applying to the whole document body can be set in a separate stylesheets, or in the head part of a page.

Attributes

Attributes traditionally provided, but now deprecated, are:-

background=url - give the url of an image to be tiled in the background

bgcolor=value. Sets the background color.

bgproperties=value. Set fixed, stops background images scrolling with document content

leftmargin=value - set the size in pixels of the documents left margin

text=color - set the colour of regular text

topmargin = value - set the size in pizels of the document top margin

Rather than assigning attributes directly to the body element it will generally be better to use a linked or embedded stylesheet.

<head> can be followed by either <body> or <frameset>


<body>
  ...
</body>

Body may be replaced by Frameset elements (but we don't use frames)


<a> ... </a>

Anchor elements provide both the links and the defined locations in a document.   The anchor element is used both as a hyperlink position to leave from or as one to go to. Using the anchor with an href=attribute and a URL make it an origin or "link". Using the anchor with a name= and a fragment identifier makes it a target anchor.

<a href="http://www.fred.com/">Visit Fred's Bookstore</a>

href="url" - the site and location to link to

Specifying href= and a URL as a target makes this anchor into an ‘origin hypertext reference’ - usually called a link. The example URL is “absolute”, it fully specifies what has to be done to find the resource. The URL will be broken down by the browser into scheme, DNS, and path-filename. If no filename or location are specified, as is true here, then the top of the default homepage called index.html is the default.

<a href="details.html" title="detailed info" >More Info</a>

This short URL is a relative link, it doesn't fully specify where the resource is. The browser will only find it if there is a file called details.html in the path it last used (or in a “base” reference). The <a> … </a> tag pair surround the link-text. Instead of text the link can be an image <img>. Most browsers colour the link-text blue and put an underline so users can spot that it's there. If this rather staid behaviour is too gaudy it can be stopped - see below . Browsers also change the cursor to a pointing hand when it is over the link as standard.

The rather odd <a> for anchor name is actually used for links. The <link> element itself is given in the header of an html document and specifies its relationships with other documents - for instance the css to be used.

If the cursor hovers over a link and there is a title= attribute then the content of the title will be shown, usually in a pale yellow pop-up box. The anchor tag can also support an alt= as well.

name="#fragment" or id="#fragment"

Specifying name= and a fragment identifier makes this a target hyperlink. Browsers can then move straight to the document and the specific fragment using the US-pound sign # to identify the fragment. So an origin of

<a href="example.com/soup.html#ingredients">Ingredients</a><br>

Should go to that URL and to the target within it called "ingredients".

Within the "soup" page the target can be marked by

<a id="ingredients"></a>

Scattering destination anchors through a document isn't always convenient and isn't necessary. Any element with an id can be a destination.

<a href="#section1">Introduction</a><br/> <a href="#section2">Background</a><br/> ...
<h2 id="section1">Introduction<h2> ...section 1... <h2 id="section2">Some background<h2> ...section 2...

As said, most browsers colour links blue and put an underscore. To suppress this default behaviour and remove underlines on links one way is to put an inline style

<a style="text-decoration:none" href="link.html">This is an unusual link, it has no underline</a>

A link defined by <a> or <link> can have roles specified via the "rel" and "rev" attributes. For instance:

<head> ...other head information... <title>Chapter 5</title> <link rel="prev" href="chapter4.html"> <link rel="next" href="chapter6.html"> </head>

Attributes

class="..." - any classname. stylesheets may apply

id="..." - any id unique to the page. stylesheets may apply

href="url" - the destination for a link expressed as a URL

name="#fragment" - the name of this location within a page

title="..." - a text which will display if the cursor hovers

style="background:red"- styles should generally be provided by stylesheets but can be provided inline where something specific is required.


<img src="url" alt="alt text">

Insert an image inline into the current text flow.

The <img> tag was created by Marc Andreesen as part of NCSA Mosaic, contributing to its meteoric rise in popularity and the foundation of Netscape. The tag has been standard since the HTML 2 specification. Some of the Web's developers have never been happy with how it was implemented and Dave Raggett tried to introduce an alternative ‘ <fig> ’ tag.

The <img> tag might have been replaced by <object>, an all-purpose method for inserting non-text objects into pages. However <img> is widely used. The problem with <object> might be over complexity of the options when all that is wanted is an image. (see below)

test image
<img src="//mindmachine.co.uk/acatalog/quicksearch.gif" alt="test image" title="example image" >

Attributes

src="url"

specify the source URL of the image to be displayed

alt="test image"

Give an alternative text to present if the image can't be displayed. This is considered compulsory because some browsers and some users can't see images. Safari and Chrome do not display the "alt". Text can also be supplied using the title.

title="test image"

Give a text explanation of the image on ‘mouseover’. Text can also be supplied using the alt.

align="type" [ top | middle | left | right | bottom ]

Align the image to one of the types: top, middle, left, right or bottom (default).

The original HTML 2 specification supported top, middle and bottom attributes. TOP aligns text after the <img> tag to the top of the image. Bottom places the bottom of the image in line with the text baseline - which looks odd in many cases but has the least effect on text flow. MIDDLE aligns text to the middle of the image - and may look right if the image is inline with the text.

Left and right alignment values were added in HTML 3.2. If left is specified the image will appear at the left margin and text flow around it's right hand side. If right is specified the image will be at the right margin of the window with text round its left hand side.

The <br> tag can be used to push text clear of the image - eg <br clear=all>. The alignment attribbute is deprecated in favour of using stylesheets.

Minor Attributes

border="n"

Set the pixel thickness of a border around images, the default is usually none. Border colour is the text colour of the document

<img src="icon.jpg" border="1">

height="n"

width="n"

Vertical and horizontal width overrides giving the desired dimension of the image in pixels. In no dimensions are given those of the image are the default. The height and width attributes can be used to fit a large image into a smaller space or to spread a small image across a larger one. User agents do their best to scale objects to match the dimensions. Where dimensions are expressesd as a percentages they are based on the space available, not on the netuarl size of the image, objkect or applet. Designers sometimes spread one or two pixels over a space to achieve the effect of a colour wash. It is usually better to scale the picture to fit the expected space.

hspace="n"

vspace="n"

Puts a margin of whitespace around images, applets or objects. There is usually a small, unspecified default value. Use of these attributes is deprecated in favour of stylesheets.

<img src="../Bmp/W-PatchBlue-Wave2.gif" NOSAVE height=46 width=291>

lowsrc="URL" a lower resolution image browsers may choose.

ismap

Images with this attribute are clickable imagemaps. Clicking on the image sends pixel coordinates to a sever imagemap CGI application. Client side imagemaps are now more popular. See usemap.

usemap

Gives the URL of the document that contains map data

<img ismap src="country.jpg" usemap="maps.html#map1>

datasrc=url - Specify the URL of tabular data

datafld=url - Identify a column in previously identified tabular data

dynsrc=url - Specify the URL of a video clip to be displayed

vrml=url - Specify a VRML world to embed in a document

<img vrml="vr/hotel.vrml">

controls - add playback controls for embedded video clips

start=[fileopen, mouseover] - event that triggers dynamic behaviour

loop=[n, infinite] number of times dynamic behaviour repeats.

class="..." - any classname. stylesheets may apply

id="..." - any id unique to the page. stylesheets may apply

name="..." - a name which bookmarks, scripts and applets can use to reference the image.

name="#fragment" - the name of this location within a page

title="..." - a text which will display if the cursor hovers

style="background:red"- styles should generally be provided by stylesheets but can be provided inline where something specific is required.

Minor Attributes

lang, dir,

onclick, ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,

onkeypress, onkeydown, onkeyup,


<object>...</object>

Insert an object into a page. The object can be any MIME-type the browser understands. This element can be used to specify pictures, applets, OLE controls and other media objects including an embedded HTML page.

<object data="//mindmachine.co.uk/acatalog/quicksearch.gif" alt="test image" > </object>
Object displays or this text

Attributes

data=url - Specify the URL of the data used for the object

type="..." - indicates the MIME type of the embedded object

codebase=url - codebase to be used by the object, base directory for files

codetype=codetype - Specify the MIME media type of the code

declare -defines the embedded object without actually loading it

standby="..." - message to display whilst the browser loads.

<param name=playback> Parameters for the object. The param attribute should only be used as a child of object although it was originally introduced with <applet>.


align="type" [ texttop | middle | textmiddle | left | center | right | bottom | baseline | textbottom ]

Align the image to one of the types listed below.

align="texttop" - aligns the top of the object with the top of the surrounding text.

align="textmiddle" - aligns the middle of the object with the middle of the surrounding text.

align="textbottom"- aligns the bottom of the object with the bottom of the surrounding text.

align="left" - embeded object floats left between edges of the window, similar to the the align attribute of the <img> tag

align="center" - embeded object floats center between edges of the window.

align="right" - embeded object floats right between edges of the window.

align="middle" - aligns the middle of the objecct with the baseline of the surrounding text.

align="baseline" - aligns the bottom of the object with the baseline of the surrounding text.

Setting object position using attributes is deprecated, stylesheets should be used instead.


height="n" - vertical dimension in pixels

vspace="n" - margins at the top and bottom of the object

width="n" - horizontal dimension in pixels

hspace="n" - margins to the left and right of the object

border="n" - width in pixels of a border round the object


class="..." - any classname. stylesheets may apply

id="..." - any id unique to the page. stylesheets may apply

name="..." - a name which bookmarks, scripts and applets can use to reference the image.

title="..." - A text to show as a tooltip or context-sensitive help. Depending on the object embedded there may be no opportunity to show a tooltip; images do, web pages don't

tabindex="n" - position in the browser tabbing order.

classid="..." - the URL of an object resource

datafld="..." - selects a column in a block of tabular data

datasrc="..." - location of tabular data to be bound within the document


shapes - indicated that the embedded document has shaped hyperlinks (imagemaps)

usemap="URL" - client side imagemap to use with the embedded object.

... etc - "object" needs more work.


Here is an example of an embedded object - put in with:

<object data="//mindmachine.co.uk/index.html" height="200px" width="400px">failure note</object>


Note that embedding a page in another slows things down - so its commented out at the moment.

The HTML 4.01 Specification says "The behavior of a user agent in cases where a file includes itself is not defined." - if you use recursion be ready to press reset when memory fills up.


<applet>

<applet> ... Java applet

Only works for java applets. Deprecated in favour of <object>.


<base>

Specify the base URL for all relative URLs in this document

Special values are _blank _parent _self and _top

<base href="http://www.fred.com/info/">

<p> ... </p>

The <p>tags indicate that the selected text forms a paragraph. The browser should set the material out slightly separated from surrounding blocks of text. <p> tags are paired, a paragraph opens with <p> and closes with </p>. Historically the pairing was optional and a paragraph closed when a construct that stopped a paragraph came along, such as the next <p>

Attributes

align=type [left | center | right ]

<p align="center"> free beer! </p>

Align text within the paragraph to left, center or right.

style="..."

<p style="background:red; color:white">

background:red; colour:white

Specify inline style commands for this paragraph

class="..." - any classname. stylesheets may apply

id="..." - any id unique to the page. stylesheets may apply

width="n" specifies a horizontal width for the paragraph in pixels

title="..." - a title to be used, typically shown as a tooltip when the cursor is over the paragraph.

Specifying the alignment and width of the paragraph should normally be done by giving structural information as to what is special about this paragraph using class or id, and then making provision in the stylesheets.

lang, dir,

onclick, ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,

onkeypress, onkeydown, onkeyup,


<div> ... </div>

Create a block level division within a document. Visually <div> on its own does very little. Unlike most block-level elements, <div> inherently creates just a line break not a paragraph break. The <div> element is intended to hold logical divisions of a text perhaps greater than a paragraph in size which can then be styled with CSS using descendant selectors. <DIV> was introduced in HTML3.2.

<span> is the inline equivalent of <div>. Visually <div> does (usually) create a paragraph, whilst <span> has no effect until styling is used.

Align=type [ left | center | right | justify ]

Gives all selected text the required alignment. Both margins can be aligned with align-justify.

DIV elements can be organised heirarchically, and in combination with style sheets the different divisions can have a different appearance.

<div align="center" > Some .... content </div>

Attributes

nowrap

<div align="left" nowrap >
Here is some text in a <div> with the nowrap attribute set so that if you resize the window it shouldn't wrap (but it does in Firefox!). Now what could be the use of that?

This example might be broken by being in the "results" div.

title="..." - Text to show as a tooltip or context-sensitive help.

class="..." - any classname. stylesheets may apply

id="..." - any id unique to the page. stylesheets may apply

style="..."

style commands can be applied within a <div> for instance

style="background: lime"

datasrc="..." specifies a source of data

datafld="..." selects a column from a previously identified source of tabulated data

dataformatas=type [ text | html | none ]

Select a source of data to bind to, select a column within it and format it as text or html.

Minor attributes

lang, dir,

onclick, ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,

onkeypress, onkeydown, onkeyup,


<span> ... </span>

Create an inline division within a document. Visually <span> does nothing, it just provides the markup for a logical subdivision in a document that can then be tyled using selectors. <SPAN> was introduced in HTML 4.

"The DIV and SPAN elements, in conjunction with the id and class attribute, offer a generic mechanism for adding structure to documents. These elements define content ... but impose no other presentational idioms on the content."   Span and div elements have no innate meaning other than to divide the document up in a way that might be used for

  • presentation in conjunction with style sheets.
  • structure in conjunction with document parsing software.

Attributes

The attributes most likely to be used with span are class, id and style

class="..." - any classname. stylesheets may apply

id="..." - any id unique to the page. stylesheets may apply

style="..."

Style commands can be applied within a <span> - and often are. For instance:

<p>a ... paragraph having a <span style="background: lime"> phrase with a lime background<span> in it </p>
Results in this paragraph having a phrase with a lime background in it.

minor attributes

lang, dir,

onclick, ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,

onkeypress, onkeydown, onkeyup,


<br/>

Breaks a line of text and resumes at the next line. Prevents text alignment around images. The <br> tag is not paired; because of this it is preferable to write it with a built in tag closer <br/>.

Attributes

clear=margin [ all | left | right | none ]

clear=left

Break the text and move downward until the margin is clear. Margin can be left, right or all to force text to clear pictures set at the margin.

clear=right

clear=all

clear=none

To prohibit a break use the &nbsp; entity (&#160; or &#xA0) to act as a space but not create a line break.

class="..." - any classname. stylesheets may apply

id="..." - any id unique to the page. Note the id applies to only one <tag>

style="..."

title="..."

The <br/> does allow a style and title. Heres a br ‘
’ with a style and a title. But since <br> is not visible what can it do with them?


<font>... </font>

Sets and changes the browsers font for selected text. Superficially this sounds like a good idea but in practice it is almost always better to use the document structure and stylesheets or the ‘style’ attribute on any other tag rather than the font tag. The <font> tag was standardised in HTML 3.2 and then deprecated in HTML 4.

HTML WYSIWYG editors (Composer, Komposer, Seamonkey, Dreamweaver etc) are usually obsessed with respecifying the font so that as much as half the markup in a file can be reiterations of it.

<font size="+2">Elephants</font>are<font size="+3">Great</font>.
Elephants are Great.

font color="green" font size="4" font size="+1" font face="Courier"

Attributes

color=value [ red | green | blue | #rrggbb ]

Sets the text color to one of 100+ named colors or to a color specified by the symbol # followed by either 3 or 6 hexadecimal digits giving the red, green and blue brightness.

face=list []

Set the typeface to the first available in the comma separated list

size=value [ 1 ... 7 | or -3 | +3 | ... -1 | -3 | +1 | +3 ]

Set the size to an absolute value (1 to 7) or relative to <basefont> using +n or -n

<font color="#FF0000">1</font>

<basefont>... </basefont>

Sets the normal text within a page. Specific font size values are then relative to this setting.   The <basefont> setting is made in the header. It is almost always better to use the document structure and stylesheets rather than to explicitly set basefont.

Attributes

<basefont size="5">

Attributes

color=value [ red | green | blue | #rrggbb ]

face=list []

size=value


<b>, <i>, <u>, <s>, <big>, <small>, <tt>

The font style elements are covered as a group here because they all do similar tricks and have the same attributes of class, id, style and title.

Font style tags appeared in HTML 2 and more were added in HTML 3.2. Some of them are deprecated in the HTLM 4.01 specification. The phrase elements are prefered. Font style elements like <b> for bold and <i> for italics have proven useful and are not (yet) deprecated in favour of <em>. The current draft of HTML 5 includes <b>, <i> and <small>

<b> ... </b> Format the enclosed text in a bold typeface.

<p>How do <b>you</b> do? </p> - How do you do?

<i> ... </i> Format the enclosed text in italic typeface..

<p>How do <i>you</i> do? </p> - How do you do?

<u> ... </u> Enclosed text formats with an underline. May look like a link. Deprecated

<p>How do <u>you</u> do? </p> - How do you do?

<big> ... </big> Format the enclosed text in a bigger typeface.

<p>How do <big>you</big> do? </p> - How do you do?

<small> ... </small> Format the enclosed text using a smaller typeface.

<p>How do <small>you</small> do? </p> - How do you do?

<sub> ... </sub> - Format enclosed text as a subscript.

<p>How do <sub>you</sub> do? </p> - How do you do?

<sup> ... </sup> - Format enclosed text as a superscript.

<p>How do <sup>you</sup> do? </p> - How do you do? or more sensibly E=MC2

<strike> ...</strike> - Format the enclosed text struck through with a horizontal line.

<p>How do <strike>you</strike> do? </p> - How do you do?

<tt> ... </tt> - Format text monospaced or "teletype"- usually in Courier.

<p>How do <tt>you</tt> do? </p> - How do you do?

<bdo> Bidirectional Override

<p>How do <bdo>you</bdo> do? </p> - How do you do?



Phrases

Phrase elements convey a meaning. Browsers may attempt to display them differently from unmarked text; and this can be ensured using style sheets. Search engines and indexers can use phrase elements more reliably than font information.

<Hn> ... </Hn> Format the enclosed text as a level n header, n can be 1 to 6 with 1 most important. More important headings will generally be rendered in larger fonts.

<h3>A Small Headline</h3>

A Small Headline

<em> ... </em> - Format with addtional emphasis (often italicised by default)

<p>How do <em>you</em> do? </p> - How do you do?

<strong> ... </strong> - indicates strong emphasis (often bold by default)

<p>How do <strong>you</strong> do? </p> - How do you do?

<cite> ... </cite> - The enclosed text is a citation or reference to other sources (see also "q" and "blockquote").

<p>How do <cite>you</cite> do? </p> - How do you do?

<code> ... </code> - The enclosed text is a code sample. Use pre for segments longer than one line.

<p>How do <code>you</code> do? </p> - How do you do?

<dfn> ... </dfn> - Format the enclosed text as a definition- this is the defining instance of the enclosed term.

<p>How do <dfn>you</dfn> do? </p> - How do you do?

<abbr> ... </abbr> - indicates an abbreviated form ( eg WWW, HTTP, URI, etc)

<p>How do <abbr>you</abbr> do? </p> - How do you do?

<acronym ... </acronym>- indicates an acronym (eg WAC, radar, etc)

<p>How do <acronym>you</acronym> do? </p> - How do you do?

<samp> ... </samp> - designates a sample output from a program or script

<p>How do <samp>you</samp> do? </p> - How do you do?

<kbd> ... </kdb> - indicates text to be entered by the user

<p>How do <kbd>you</kbd> do? </p> - How do you do?

<var>... </var> - indicates an instance of a variable or program argument

<p>How do <tt>you</tt> do? </p> - How do you do?

eg
To copy a file type <samp>cp <var>file1</var><var>file2</var><samp> then press enter.

<pre> ... </pre> - designates a fragment of computercode

See section on <pre> Below.


<blockquote>  ... </blockquote>

Normally gives left and right indentation of enclosed text to make it evident that the material is being quoted. "blockquote" is intented for long quotations, so presentation only differs over several lines.

Attributes

cite="..." - specifies a reference URL for the citation.

The cite attribute is supposed to be a URL

class="..." - any classname. stylesheets may apply.

id="..." - any id unique to the page.

style="..." - for instance style="background:red;" and suchlike.

title="..." - the usual context sensitive help and tooltip possibilities.

minor attributes

lang, dir,

onclick, ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,

onkeypress, onkeydown, onkeyup,

When the two teams finally met Stanley is reported to have said <blockquote> Dr Livingston I presume. </blockquote>

<blockquote>Dr Livingston I presume.</blockquote>

Examples

Dr Livingston I presume.

A blockquote really needs a big bit of text to make the difference in the margins quite noticeable.

So here is some text both outside and inside a <blockquote>. Its a brief excerpt at random from "Doctor Faustus" by Thomas Mann, A novel about genius possessed. Faust sold his soul for superhuman powers. Germany in 1943-5 faced catastrophe.

He is right, Matthaeus Arzt declared roundly. The others called him the Socialist, because the social was his passion. He was a Christian Socialist and often quoted Goethe's saying that Christianity was a political revolution which, having failed, became a moral one. Politicial, he said now, it must again become, that is to say social: that was the true and only means for the disciplining of the religious element , now in danger of a degeneration which Leverkuhn had not so badly described. ...

Notice that the blockquote is inset a bit. Although the <blockquote> has a cite attribute it doesn't seem to work here. Maybe I need more information.


<q> ... </q>

The <q> tag is intended for short quotations that don't contain paragraph breaks. The browser should respond by wrapping the text in quote marks.

Attributes

class="..." - any classname. stylesheets may apply.

id="..." - any id unique to the page.

style="..." - for instance style="background:red;" and suchlike.

title="..." - the usual context sensitive help and tooltip possibilities.


cite="..." - specifies a reference URL for the citation.

The cite attribute is supposed to be a URL

Fred says <q> you need to re-pot that geranium </q>
Fred says you need to re-pot that geranium

A browser should respond to the <q> tag by putting the selected text in quote-marks. Not all browsers are compliant.

It would (of course) be quicker to type the quotation marks than the <q>...</q> tag pair. The same idea can be expressed with the «&laquo; &raquo; » quote marks or “&ldquo; and &rdquo;” duo. The markup value of the HTML tag is higher, for instance we could give the name of the character in a speech by:

<q class="Juliet">Romeo, Romeo, Wherefore art thou ... </q>

And the size and colour of the quotes could be varied.

Romeo, Romeo, Wherefore art thou ...

<pre> ... </pre>

Allows inclusion of pre-formatted text. The browser will attempt to reproduce what it is given, typically using a fixed pitch font such as courier and preserving white-space given in the text.

If the text overflows the screen the browser will not automatically wrap it.

Character codings like &amp; and html are still interpreted. So if the text has natural linebreaks and you add <br/> there will be double line-spaces.

<pre> can contain any inline element except <img> and <object> and the font tags <big>, <small>, <sup> and <sub>.

<pre> ought to make it easy to scrape and paste program code and output samples as they appear on the screen. It isn't that massively helpful if they might overflow a typical browser window.

The <pre> tag is a partial escape from the world of browser-interpreted HTML to that of plain text. There used to be a <PLAINTEXT> tag and <pre> replaces it. Its supposed to replace <xmp> as well.

Attributes

class="..." - any classname, stylesheets may apply.

id="..." - any id unique to the page (or is it unique to the <pre> tag).

style="..." - for instance style="background:red;" and suchlike.

title="..." - the usual context sensitive help and tooltip possibilities.

width="n" - horizontal dimension allowed. Not widely supported and deprecated

Example

<pre style="width:600px; border:1px solid orange;> Allows inclusion of pre-formatted text. The browser will attempt to reproduce what it is given, typically using a fixed pitch font such as courier and preserving white-space given in the text. If the text overflows the screen the browser will not automatically wrap it. Character codings like &amp; and html are still interpreted. So if the text has natural linebreaks and you add <br/> there will be double line-spaces. </pre>
Allows inclusion of pre-formatted text. The browser will attempt to reproduce what it is given, typically 
using a fixed pitch font such as courier and preserving white-space given in the text.
If the text overflows the screen the browser will not automatically wrap it.
Character codings like &amp; and html are still interpreted. So if the text has natural linebreaks and you 
add <br/> there will be double line-spaces.

The <pre> tag is covered in section 9.3.4 of the HTML 4.01 Specification.

The <pre> tag can be irritating because if a line length exceeds the screen width the whole document and not just the <pre> block gets a horizontal scroll bar. That keeps on implying to the user that there is something at the right hand side when for the most part there is not.

This is much the same thing in a div.

Allows inclusion of pre-formatted text. The browser will attempt to reproduce what it is given, typically using a fixed pitch font such as courier and preserving white-space given in the text. If the text overflows the screen the browser will not automatically wrap it. Character codings like &amp; and html are still interpreted. So if the text has natural linebreaks and you add <br/> there will be double line-spaces.

Clearly I need to experiment to get what I want. A cell with chiselled border and h-scroll will probably need a form with an input box.


<address> ... </address>

A block intended to hold any kind of page-author address information. It seems to be mainly intended to help search engines and indexers.

Attributes

class="..." - any classname, stylesheets may apply.

id="..." - any id unique to the page (tag?).

style="..." - for instance style="border:1px solid orange;" and suchlike.

title="..." - the usual context sensitive help and tooltip possibilities.

align=[ left | center | right ] - deprecated in favour of stylesheets.

Examples

<address> <A HREF=mailto:fred@fred.net">Fred Bloggs: fred@fred.net</> </address>

or
<address> Fred Bloggs <br/> The Laurels <br/> Willow Dene <br/> Dorset <br/> </address>
<address style="width:600px; padding:20px; background:lightgrey; border:1px solid orange;">

<a href="//mindmachine.co.uk/index.html">mindmachine.co.uk</a>

<p>Phone: 0191 417 9295 email: admin@mindmachine.co.uk</p>

</address>

mindmachine.co.uk

Phone: 0191 417 9295 email: admin@mindmachine.co.uk

The address tag doesn't seem to do much beyond putting a wrapper around text. The "HTML tags" document suggested it might right-justify or otherwise change the format but that is now left for stylesheets to achieve. So <address> is really just a public tag for a specific purpose.

Unfortunately spammers are indexing all the site-names they can find, so highlighting the address in this way may have limited appeal.


<hr/>

break the current text flow and insert a horizontal rule. This is typically used as a section marker, giving the user extra visual cues about their position in the text. Another use is to put horizontal emphases around a text without using a box border.

Since presentational lines can be drawn by stylesheets the <hr> might not be needed but it is used.

Attributes

align="type" [ left | center | right ]

Alignment wont make a difference unless the line is shorter than pagewidth.

color=value [ red | green | blue | #rrggbb ]

"noshade" - Do not use a 3-D shading on the rule

size="pixels" - set the thickness to an integer number of pixels.

The default size seems to be about 3

width="value" - Set the width to an integer number of pixels or percent of pagewidth.

class="..." - any classname, frequently used to distringuish types of line.

id="..." - a unique id (why would you assign an id to line? ).

style="..." - for instance style="width:50% ; color: red" or"border:1px solid orange;" and suchlike.

title="..." - the usual context sensitive help and tooltip possibilities.

Alignment, size and width are all deprecated in HTML 4 in favour of stylesheets.

Examples

<hr style="width:20%; color:lime"> <hr width="40%" color="red"> <hr width="60%" color="yellow" size="4px"> <hr width="80%" color="blue" size="1px"> and <hr class="subdivision" title="this one has a tooltip demonstrating it works" />





<center> ... </center>

Display the enclosed text centre justified, that is with text an equal distance between the left and right edges of the page.

<center>My Beautiful Lauderette </center>
My Beautiful Lauderette

Center came into widespread use so it got included in HTML 3.2 but then deprecated in HTML 4. If there is some reason to not use style the same job can be done with <div>

<div align=center > .. tested with align=center .. </div>
or better still
<div style="text-align:center"> .. style="text-align:center" .. </div>
Resulting in

.. tested with align=center ..
.. style="text-align:center" ..

The center tag is a direct layout instruction and as such is deprecated in favour of stylesheets or inline style attributes.

Center is one of those tags that are so handy it is quite often used in older documents, however avoid it for new pages.



Lists

There are three kinds of list; Unordered List <ul>, Ordered List <ol> and Definition List <dl>. there used to be <dir> and <menu> lists as well, but since they overlapped with what the others do they are now deprecated. Lists are covered in section 10 of the HTML 4.01 specification and section 12 of CSS 2.1 .

Writers may prefer unordered lists, perhaps because the idea remains noncommital. Readers, especially those with visual disabilities, might prefer ordered lists because the numbering gives extra visual context.

<ul> defines an Unordered List containing one or more elements. The list starts with a <ul> tag and each list element has an <li> tag. The list is actually presented in order, but it is ‘un-numbered’ by default.   Each list point displays in an orderly progress down the page with each point normally being marked with a black disc.

<ol> defines an Ordered List. Things are as they would be for <ul> excepting that the points are numbered in some way, by default in decimal numbers but there are a range of choices.

Lists can be nested so that there is a list with other lists in it. With a nested list the browser will normally show nested elements further inset with a different bullet-point such as a black circle.

Explicitly enclosing HTML items in a list isn't necessary. CSS can specify display: list-item   and the items identified will then be treated as a list.

A list ends a paragraph syntactically; that is a stylesheet doesn't carry on a paragraph style if a list is emedded within it. This is a bit counter-intuitive because in ordinary use the set of arguments comprising a paragraph might contain a list but in HTML that doesn't seem to be true.

<ul>...</ul>

Simple Example

... some other text <ul> <li> List element </li> <li> List element </li> ... </ul> and after those points ...

Results in

... some other text
  • List element
  • List element
  • ...
and after those points ...

The <ul> and <ol> lists are made up of <li> list items.

HTML Attributes

class = "..." - any classname, used to distinguish types of list.

id = "..." - a unique id.

style = "..." - for instance "color: red; border:1px solid orange;" and suchlike.

type = "type" [ square | circle | disc ] - bullet type.

For a <ul> ‘unordered’ list the types are square, circle and disc. List types available on and ordered list are given below. Note that the HTML attribute types for <ol> may work for <ul> but can't be relied on. The css list-style-type property also sets this value.

src = "url" - image to use for bullets (but this is IE4 only, use the CSS property list-style image:URL( ...) instead )

compact - display the list in a more compact manner.

start = "number" - on <ol> integer start number, deprecated.

value = "number" - on <li> integer for point number, deprecated.

CSS 2.1 doesn't have a start value for <ol> or a value property for <li> and both attributes are deprecated in HTML 4.01 so they can't be used in "strict" documents.

CSS Properties

Normally a list and the list items are given a ‘class’ and / or ‘id’ and presentation is determined using CSS rules rather than directly using the HTML "type", src and start attributes. CSS properties are:

list-style-type

list-style-image

list-style-position

list-style - shorthand giving: type position image

List-Style-Type
typemarkerstyle
square ...
circle ...
disk ...

< ul style="list-style-type:circle" > ...

List-Style-Image

Bullet points can be images. The URL specification is a bit odd.

<ul style="color:teal; list-style-image: url('s_icon_cog_1.png')" > <li>List Point 1 </li > <li>List Point 2 </li > <li>List Point 3 </li > </ul>
  • List Point 1
  • List Point 2
  • List Point 3
List-Style-Position

Markers (bullet points) are placed in an “ virtual marker box ” normally placed to the left of each list item and with a transparent background. There isn't much control over the placement of this box, excepting that it can be brought into the list-item box.

<ol style="list-style-position:inside;" >

Values for list-style-position are: outside (the default) | inside | and inherit .

List-Style

A shorthand property list-style sets all three properties at once

selector { list-style: type position image; }


<ol> ... </ol>

Defines an ascending ordered list of elements.   By “Ordered” they mean sequentially numbered, as well as numbering there are letter sequences as well. <ol> is similar to <ul> and can often be made to do the same job. This may be unwise as browsers may have implementation differences.

<ol> <li> List element 1 </li> <li> List element 2 </li> .. </ol>
  • List element 1
  • List element 2
  • HTML Attributes

    class = "..." - a classname, used to distinguish types of list.

    id = "..." - a unique id also distinguishing lists and landing points .

    style = "..." - inline style and suchlike - for example:

    <ul style="list-style-image: url('s_icon_cog_1.png')">

    type = "type" - number type.

    For a <ul> ‘ordered’ list the number types are:A(capitals), a(lowercase), I(Roman), i(lowercase Roman), or 1(Arabic=default) - Set the numbering format to

    <ol> type=“A” > <li> Line 1 </li> <li> Line 2 </li> </ol>
    1. Line 1
    2. Line 2

    Note that the HTML attribute types for <ul> disk, square and circle may work for <ol> but can't be relied on. The css list-style-type property also sets this value.

    compact - display the list in a more compact manner.

    start = "number" - on <ol> integer start number, deprecated.

    value = "number" - on <li> integer for point number, deprecated.

    CSS 2.1 doesn't have a start value for <ol> or a value property for <li> and both attributes are deprecated in HTML 4.01 so they can't be used in "strict" documents.

    CSS Properties

    Normally a list and the list items are given a ‘class’ and / or ‘id’ and presentation is determined using CSS rules.

    list-style-type - one of "decimal", "lower-roman" ... etc

    list-style-image - not wholly relevant in a numbered list

    list-style-position - outside, inside, inherit

    list-style - list-style-type, position, image

    List-Style-Type

    for an <ol> list the list-style-types are
    typenumber markerstyle
    1decimal1,2,3, ...
    1decimal-leading-zero1,2,3, ...
    alower-alphaa,b,c, ...
    Aupper-alphaA,B,C, ...
    ilower-romani,ii,iii,iv...
    iupper-romanI,II,III,IV...
    ilower-latin ...
    ilower-greek ...
    iarmenian ...
    igeorgian an, ban, gan...
    inone ...
    iinherit ...

    Note that for alphabetic list-style-types behaviour beyond 26 list items is undefined and decimal numbering is recommended.

    <ol style="list-style-type:georgian"> <li>List element 1 </li> <li>List element 2 </li> <li>List element 3 </li> <li>List element 4 </li> </ol>

    Georgian numbering has been used here for interest.

  • List element 1
  • List element 2
  • List element 3
  • List element 4
  • List-Style-Image

    If your numbering the list why do you want an image? (see ul ) .

    List-Style-Position

    Markers can be outside (default) | inside | and inherit

    List-Style

    A shorthand property list-style sets all three properties at once

    selector { list-style: type position image; }

    //
    1. List element
    2. List element
    3. List element
    4. List element
    1. List element
    2. List element
    3. List element
    4. List element

    start=n - start the list at n rather than 1. With "type=A start=3" starts at c

    <li> elements can have attributes type="square"


    Definition List

    gives a list with left-justified <dt> elements and indented <dl>

    <dl>
    <dt><strong>Lower Cost</strong>
    <dd>The new version of this product costs significantly less than the previous one!
    </dd></dt>
    <dt><strong>Easier to use</strong>
    <dd>We've changed the product so that it's much easier to use!
    </dd></dt>
    <dt><strong>Safe for kids</strong
    <dd>You can leave your kids alone in a room with this product and they won't get hurt (not a guarantee).
    </dd></dt>
    </dl>
    
     

    The DIR and MENU list elements have much the same structure as UL, use of these elements is now deprecated.


    Forms

    <form> ... </form>

    Delimit a form


    action=url Specify the URL of the application that will process the form, the default is the current URL
    enctype=encoding Specify how the form element values will be encoded
    method=style Specify that parameters are passed by get or put

    -
    <input types =checkbox>
            =file
            =hidden
            =image
            =password
            =radio
            =reset
            =submit
            =text

    -
    <BUTTON> Sets up a button to submit or reset a form or to activate a script. Use the IMG element within BUTTON to specify a graphical button.

    <BUTTON type="button" value="Run Program" onclick(doit)>Click It</BUTTON>

    Attributes

    accesskey="keyseq"

    name=name - Gives a name to the value passed to the form processor
     


    Tables

    Basic table layout relies on three elements, declaring tables, rows and elements:
     
    Outline Structure
    <table>
    
    <tr> a table row <td> a bit of table data</td> <td> more table data</td> ... </tr> <tr> ...</tr> ... </table>
    Example
    <html>
    <head>
    <title> colspan & rowspan </title>
    </head>
    <table border=1 cellspacing=20 cellpadding=10>
    <tr>
    <td rowspan=2>rowspan=2</td>
    <td>column- No span</td>
    <td>column- No span</td>
    </tr>
    <tr>
    <td colspan=2>second row- column span=2</td>
    </table>
    </body>
    </html>
    

    <table> ... </table>

    Define the body of a table

    align=position - Align the table in the surrounding text flow - left | right
    background=url - Specify an image to be tiled in the background of the table
    bgcolour=color - Define the background colour for the entire table
    border=n - create a border n pixels wide
    bordercolor=color - Define the border color for the entire table
    bordercolordark=color - Define the dark border-highlighting color for the table
    bordercolorlight=color -Define the light border-highlighting color for the entire table
    cellpadding=n - Place n pixels of padding around each cells contents
    cellspacing=n - Place n pixels of spacing between cells

    frame= [void | above | below | hsides | lhs | rhs | vsides | box | border ]
    void removes outer borders

    hspace=n- Specify the horizontal space in pixels added at the left and right of the table.
    rules= [ all | cols | groups | none | rows ]
    vspace=n- Specify the vertical space in pixels added at the top and bottom of the table
    width=n - Set the width of the table to n pixels or a percentage of the window width.
     

    <tr> ... </tr> Define a table row

    <td> ... </td> Define a table data cell

    align=position - Align cell content left | center | right
    background=url - Specify an image to be tiled in the cell background
    bgcolor=color - Define the background color of the cell
    bordercolor=color - Define the border color for the cell
    bordercolordark=color - Define the dark border highlighting color for the cell
    bordercolorlight=color - Define the light border highlighting color for the cell.
    colspan=n - This cell spans n columns
    nowrap - Do not automatically wrap and fill text in this cell
    rowspan=n - Have this cell staddle n adjacent rows
    valign=type -Vertically align this cell's contents to the top | middle | bottom | baseline
    width=n - Set the width of this cell to n pixels or a percentage of the table width.


    Frames

    Frames display several pages in one browser window. Because the frames are independent windows use of frames substantially changes an HTML page:

    A frameset is declared instead of a body. The frameset may be subdivided

    Frames take their content from independently defined HTML pages
     

    Frames used to create hot fury in the html community. Much of what they do can be done with tables and css.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
    <html lang="en">
    <head>
    <title>Apache HTTP Server</title>
    </head>
    <frameset cols=200,*>
    <frameset rows=275,*>
    <frame src=helpform.html scrolling=no marginwidth=0
    marginheight=5 name=help noresize>
    <frame src=date.php3 scrolling=no marginwidth=5
    <marginheight=25 name=dat noresize>
    </frameset>
    <frame src=index1.html scrolling=auto marginwidth=5 name=right noresize>
    </frameset>
    </html>
    
      <frameset> ... </frameset> <frame> ... </frame>
     

    --

    Document Changes

    <INS> ... </INS>

    <DEL> ... </DEL>

    INS and DEL are intended to mark up revisions and changes in a document.

    For instance, text added will be shown in a highlighted colour, whilst deleted material is shown in strikeout font.

    Attributes

    cite=url - pointer to a url giving the reason for the INS or DEL

    datetime=YYYY-MM-DDThh:mm:ssTZD

    <INS="cite="http://w3.org/" datetime="1999-03-12">


    <AREA> ... </AREA>

    Client-side image map area


    <MAP> ... </MAP>

    An imagemap is a picture that contains hotspots, usually leading to different URLs. Although imagemaps can be useful with geopgraphical maps , but the effect can be duplicated with simpler elements.


    <BGSOUND>

    Define background audio for the document.

    Proprietary HTML used in Internet Explorer - deprecated.

    src=url provide a url for the audio file

    loop=value Set the number of times to play the audio, value may be an integer or infinite.

    <BGSOUND SRC="scream.wav" loop="2">




     

    Other attributes Most elements can take attributes lang and dir Intrinsic events onclick, ondblclick, onmousedown, onmouseup, onmouseover onmousemove,onmouseout, onkeypress, onkeydown, onkeyup,