A simple HTML document has the following structure
|
A frame HTML document has the following structure
|
Structural Definitions |
TAG | Name | Example |
---|---|---|
CITE | Citation | Arthur C Clarke, Against The Fall of Night, 1953. |
EM | Emphasis | Emphasis |
STRONG | Strong Emphasis | Strong Emphasis |
CODE | Code | Code |
SAMP | Sample Output | Sample Output |
KBD | Keyboard | Keyboard |
VAR | Variable | Variable |
DFN | Definition | Definition |
ADDRESS | Author's Address | Author's Address |
Presentation Formatting |
TAG | Name | Example |
---|---|---|
B | Bold | Bold |
I | Italic | Italic |
S STRIKE |
Strikeout | |
SUB | Subscript | Subscript |
SUP | Superscript | Superscript |
TT | Typewriter | Typewriter |
BIG | Large Font Size | Large Font Size |
SMALL | Small Font Size | Small Font Size |
CENTER | Center | |
BLINK | Blink | To or not to . Not, I think. |
U | Underline | Underline |
<!-- | Comment | Tag encapsulates all text until -->. Can be used to comment out other tags. Can be nested. |
WBR | Word Break | Word |
NOBR | No Break |
|
Block elements |
TAG | Name | Attributes | Example |
---|---|---|---|
BLOCKQUOTE | Block Quote | ALIGN = {left center right justify} |
Science Fiction has some memorable prose
In this Universe the night was falling: the shadows were lengthening toward an east that would not know another dawn. But elsewhere the stars were still young and the light of morning lingered: and along the path he had once followed, Man would one day go again.as exemplified in the justified quote above. |
PRE | Preformatted | WIDTH = # |
Preformatted text with line breaks, and a maximum line width of 30 characters. |
P | Paragraph | ALIGN = {left center right justify} |
Paragraph one.
Paragraph two. This paragraph has alignment set to "justify". Not all browsers support justified alignment. After closing tag. Closing tag is optional. |
BR | Line Break | CLEAR = {left right all} | Line break exhibit. CLEAR moves vertically down until left, right, or all margins are clear of images. |
HR | Horizontal Rule |
ALIGN = {left right center}
NOSHADE SIZE = # WIDTH = {% #} |
Horizontal rule. No end tag. Size = 10 No shade Width = 50% Width = 100 |
MULTICOL | Multiple Columns | COLS = # GUTTER = # WIDTH = # % |
|
SPACER | Spacing |
TYPE = {block horizontal vertical}
HEIGHT = n WIDTH = n SIZE = n |
|
Lists |
HTML Document |
TAG | Name | Attributes | Example | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
!DOCTYPE | Document Type | HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN No closing tag. | |||||||||||
HTML | Hyper Text Markup Language |
A plain text file structured with tags.
Tags are signified by a left and right angle bracket. <tag>.
HTML is not case sensitive, although attribute values, escape sequences, and URIs may be.
Encapsulates document. |
|||||||||||
HEAD | Document Head | |
Encapsulates Head Elements | ||||||||||
TITLE | Document Title | |
Title is text enclosed by tags. Used as Window Title. | ||||||||||
ISINDEX | Query | PROMPT = String | Query String sent to server. No closing tag. | ||||||||||
BASE | Base URI |
HREF = "URI"
TARGET = {"windowname" _blank _self _parent _top} |
Base URI for dereferencing relative URIS. Document URI is used by default. No closing tag. | ||||||||||
META | Meta Information |
NAME = "property"
CONTENT = "property value". NAME = "robots" CONTENT = "noindex, nofollow" HTTP-EQUIV = "Expires" CONTENT = "dd-mon-yyyy hh:mm:ss TZ" HTTP-EQUIV = "Refresh" CONTENT = "seconds; URI = URI" |
describing document properties. No closing tag. Arbitrary user specified NAME meta information could be ROBOTS, AUTHOR, KEYWORDS, DESCRIPTION, GENERATOR, and CONTENT-TYPE. | ||||||||||
LINK | Relationships |
REL = "forward relationship"
REV = "reverse relationship" HREF = "URI" |
Defines relationships with other documents and resources Relationships are {top contents index glossary copyright next previous help search}. No closing tag. | ||||||||||
BODY | Document Body |
BGCOLOR = "colour"
TEXT = "colour" LINK = "colour" VLINK = "colour" ALINK = "colour" BACKGROUND = "URI" BGPROPERTIES = "FIXED" | Encapsulates Body Elements | ||||||||||
A | Anchor |
NAME = "name"
HREF = "URI" REL = "relationship" REV = "relationship" TITLE = "title" TARGET = {"windowname" _blank _self _parent _top} |
Define hypertext links and named locations for use as targets. Can't be nested. URI example "mailto:name@domain?subject=text&body=moretext" or "http://domain". | ||||||||||
IMG | Inline Image |
SRC = "URI"
ALT = "description" ALIGN = {top middle bottom left right absmiddle absbottom texttop baseline} WIDTH = # HEIGHT = # BORDER = # HSPACE = # VSPACE = # ISMAP USEMAP = "mapname" |
|
||||||||||
MAP
AREA |
Client Side Image Map |
NAME = "mapname"
SHAPE = {rect polygon circle} COORDS = {"x1, y1, x2, y2" "x1 y1 r" "x1, y1, ... xn, yn"} HREF = "URI" |
|
||||||||||
EMBED | Embed arbitrary data object. |
SRC = "URI"
WIDTH = # HEIGHT = # ALIGN = {left center right} HIDDEN HSPACE = # VSPACE = # TYPE = "mimetype" ALT = "text" |
No closing tag. | ||||||||||
NOEMBED | HTML for Non EMBED enabled browsers | The NOEMBED tag must immediately follow the EMBED tag. | |||||||||||
BASEFONT | Base Font | SIZE = "size" | Size from 1 to 7. Should be at beginning of document. | ||||||||||
FONT | Font |
SIZE = "size"
COLOR = "colour" FACE = "font names list in order of preference" |
Size from 1 to 7, or relative, eg +1, -2. Face is not part of HTML 3.2 | 1Aa# 2Aa# 3Aa# 4Aa# 5Aa# 6Aa# 7Aa# |
Tables |
TAG | Name | Attributes | Example |
---|---|---|---|
TABLE | Table |
ALIGN = {left right center}
WIDTH = {# %} BORDER = # CELLSPACING = # CELLPADDING = # BGCOLOR = colour COLS = # BACKGROUND = "URI" BORDERCOLOR = colour |
Aligns table on page, width as specified, Border 0 or more, Cellspacing 0 or more, Cellpadding 0 or more |
CAPTION | Caption | ALIGN = {top bottom} | Placement of caption at top or bottom of table |
TR | Table Row |
ALIGN = {left center right}
VALIGN = {top middle bottom baseline} BGCOLOR = colour BACKGROUND = "URI" |
Closing tag is optional. |
TH | Table Header |
ALIGN = {left center right}
VALIGN = {top middle bottom baseline} ROWSPAN = # COLSPAN = # NOWRAP WIDTH = # HEIGHT = # BGCOLOR = colour BACKGROUND = "URI" |
Table Header cell. End tags are optional. Lines in cell cannot be broken. |
TD | Table Data |
ALIGN = {left center right}
VALIGN = {top middle bottom baseline} ROWSPAN = # COLSPAN = # NOWRAP WIDTH = # HEIGHT = # BGCOLOR = colour BACKGROUND = "URI" |
Table Data cell. End tags are optional. NOWRAP prevents linebreaking. |
Table Examples |
Table Header | |
---|---|
Table Data | |
Cell with content to right | |
Blank cell on right | |
Column span = 2 | |
Row span = 3 | Cell Width = 200 |
Cell Height = 45 Cell Background = scalelight.gif |
|
Align = right | |
Row BGColor = gold Height = 45 | Cell Align = center |
Cell BGColor = silver | Cell BGColor = steelblue |
Row Background = scaledark.gif | |
Printing white text with a black background can be a problem. |
Table with | border = 15 and | cell spacing = 15 |
Table with | border = 15 and | cell padding = 15 |
Alignment | Default | Baseline | Top | Center | Bottom |
---|---|---|---|---|---|
Default | Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Left | Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Center | Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Right | Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Rows show ALIGN, Columns show VALIGN |
Forms |
Frames |
TAG | Name | Attributes | Example |
---|---|---|---|
FRAMESET | Frameset |
ROWS = {# % * #*}{, # % * #* ...}
COLS = {# % * #*}{, # % * #* ...} BORDER = # FRAMEBORDER = {yes no} BORDERCOLOR = colour |
Used instead of <BODY>. Example coming soon, well one day. Reference. |
FRAME | Frame |
SRC = "URI"
NAME = {"windowname" _blank _self _parent _top} MARGINWIDTH = # MARGINHEIGHT = # SCROLLING = {yes no auto} NORESIZE FRAMEBORDER = {yes no} BORDERCOLOR = colour |
Example coming sooner or later.
_blank : load in new blank unnamed window. _self : load in same window. _parent : load in immediate FRAMESET parent. _top : load in full body of window. |
NOFRAMES | No Frames |
|
For non frames browsers |
Character Sets |
%20 | space | %21 | ! | %22 | " | %23 | # | %24 | $ | %25 | % | %26 | & | %27 | ' | %28 | ( | %29 | ) | %2a | * | %2b | + | %2c | , | %2d | - | %2e | . | %2f | / | %3a | : | %3b | ; | %3c | < | %3d | = | %3e | > | %3f | ? | %40 | @ |
C | h | r | Name | # | Description | C | h | r | Name | # | Description | C | h | r | Name | # | Description |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
	 | Horizontal Tab |   | Space | ! | ! | ! | Exclamation Mark | ||||||||||
" | " | " | " | " | Double quotation mark | & | & | & | & | & | Ampersand | . | . | . | Full stop (period) | ||
< | < | < | < | Less than | > | > | > | > | Greater than | @ | @ | @ | Commercial at | ||||
|   | Non breaking space | ¡ | ¡ | ¡ | ¡ | Inverted exclamation | ¢ | ¢ | ¢ | ¢ | Cent | |||||
£ | £ | £ | £ | Pound sign | ¤ | ¤ | ¤ | ¤ | Currency sign | ¥ | ¥ | ¥ | ¥ | Yen sign | |||
¦ | ¦ | ¦ | ¦ | Broken Vertical Bar | § | § | § | § | Section sign | © | © | © | © | Copyright | |||
« | « | « | « | Left angle quote, guillemot left | ¬ | ¬ | ¬ | ¬ | Not | ® | ® | ® | ® | Registered sign | |||
± | ± | ± | ± | Plus minus sign | ¶ | ¶ | ¶ | ¶ | Paragraph sign | » | » | » | » | Right angle quote, guillemot right | |||
¼ | ¼ | ¼ | ¼ | One quarter fraction | ½ | ½ | ½ | ½ | One half fraction | ¾ | ¾ | ¾ | ¾ | Three quarters fraction | |||
¿ | ¿ | ¿ | ¿ | Inverted question mark | × | × | × | × | Times | ÷ | ÷ | ÷ | ÷ | Division sign | |||
• | • | • | • | bullet | … | … | … | … | horizontal ellipsis | ′ | ′ | ′ | ′ | prime = minutes = feet | |||
&Primt; | ″ | ″ | ″ | double prime = seconds = inches | ‾ | ‾ | ‾ | ‾ | overline | ⁄ | ⁄ | ⁄ | ⁄ | fraction slash | |||
← | ← | ← | ← | leftwards arrow | ↑ | ↑ | ↑ | ↑ | upwards arrow | → | → | → | → | right arrow | |||
↓ | ↓ | ↓ | ↓ | downwards arrow | ↔ | ↔ | ↔ | ↔ | left right arrow | ↵ | ↵ | ↵ | ↵ | downwards arrow with corner leftwards |
Key |
|
---|---|
Bold | HTML 3.2 |
% | Percentage, used for WIDTH attribute, % width of frame, % width of table |
# | Number. Pixels, used for WIDTH, HEIGHT, BORDER, HSPACE, VSPACE, CELLSPACING, CELLPADDING attributes. WIDTH and HEIGHT of image. SIZE of horizonal line. Characters for SELECT, INPUT. Count for START. ROWSPAN, COLSPAN. |
{ } | List of values from which one at a time can be used. |