Please note that the contents of this page will be subject to continuing updates, completions and corrections. Please E-mail any suggestions to us.
This summary does not at this point annotate to which version of HTML each element or attribute belongs. Therefore some older browsers may not respond correctly. Also this page does not pretend to be a "do it yourself" tutorial.
Probably the most complete sources of tecnical reference, continuing policy and further study can be found at the World Wide Web Consortium.
Structure of HTML Documents
Note: some elements are containers and requires both start and end tags: they are asterixed (*) For other elements (non containers) end tags are forbidden.
HTML documents should begin with a
declaration to distinguish between versions, followed by HEAD, including TITLE, and BODY elements.
- *TITLE: mandatory: appears at the top of browswer screens
- ISINDEX: for keyword searches
- BASE: absolute URL for resolving relative URLs
- *STYLE and *SCRIPT: reserved for future use
- META: meta info as name/value pairs
- LINK used to define relationships with other documents
BACKGROUND, BGCOLOR, TEXT, LINK, VLINK and ALINK: Used to set a repeating background image, plus background and foreground colors for normal text and hypertext links. Colors are in RGB (ex: "#FF00C8" or may be common VGA palette names - black, blue, gray, green, etc
Block elements include *H1 to *H6 (headers), P (paragraphs) LI (list items), and HR (horizontal rules)
- *PRE preformatted text rendered with a monospaced font and preserve layout.
- *DIV document divisions groups related elements. Can be ALIGNED.
- *CENTER text alignment to center text lines
- *UL (unordered lists) contain one or more LI list items.
- *OL ordered, or numbered lists contain one or more LI list items. The OL START attribute is used to initialize the sequence number, reset later with VALUE attribute on LI elements.
- TYPE attribute is used to set the bullet style on UL and LI elements.
- *DL definition lists contain DT elements that give the terms and DD elements that give corresponding definitions.
- *H1 to *H6 use the ALIGN attribute to set the text alignment.
- *ADDRESS for information about the author of the document.
- *BLOCKQUOTE quoted passage with indented margins.
- *FORM fill-out forms can't be nested. Attributes are ACTION, METHOD and ENCTYPE
- ISINDEX obsolete FORM
- HR horizontal rules
- *TABLE can be nested (optional CAPTION). TR elements define table rows,with one or more cells defined by TH or TD elements. Attributes are all optional: WIDTH, ALIGN, BORDER, CELLSPACING and CELLPADDING. TH and TD support attributes: ALIGN and VALIGN for aligning cell content, ROWSPAN and COLSPAN to span more than one row or column.
Text elements include *EM, *I, *B and *FONT (character emphasis), *A (hypertext links), IMG and APPLET (embedded objects) and BR (line breaks).Text elements can generally be nested but cannot contain block level elements.
Font style elements
- *TT teletype or monospaced text
- *I italic text style
- *B bold text style
- *U underlined text style
- *STRIKE strike-through text style
- *BIG places text in a large font
- *SMALL places text in a small font
- *SUB places text in subscript style
- *SUP places text in superscript style
Special Text Elements
- *A (anchor, not nested) used for hypertext links and named targets for hypertext links: attributes are: NAME, HREF, REL, REV and TITLE. NAME is the target used by URLs that target a NAMEd section. HREF supplies a URL identifying the linked document or image etc.
- *APPLET supported only by Java enabled browsers. It allows inclusion of Java applets in HTML. Contents are used if the applet cannot be loaded. Attributes are: CODE, CODEBASE, NAME, ALT, ALIGN, WIDTH, HEIGHT, HSPACE and VSPACE. APPLET uses associated PARAM elements to pass parameters to the applet.
- IMG to insert images: attributes are: SRC, ALT, ALIGN, WIDTH, HEIGHT, BORDER, HSPACE, VSPACE, USEMAP and ISMAP. Images are positioned vertically relative to the text or floated to the right or left.
- *FONT to change the font size and/or color of enclosed text: attributes are: SIZE, COLOR as Hex# or standard
- BR to force a line break: attribute CLEAR to move down past floating images
- *MAP to define client-side image maps. MAP contains one or more AREA elements that specify hotzones on the associated image and tie these hotzones to URLs.
- EM basic emphasis typically in italics
- STRONG emphasis in bold font
- DFN defining instance of the enclosed term
- CODE used for extracts from HTML "as is"
- SAMP sample output from scripts etc.
- KBD text to be typed in by the user
- VAR arguments to commands
- CITE citations from other sources
INPUT, SELECT and TEXTAREA are only allowed within FORM elements
- INPUT is used for text, passwords, checkboxes, radio buttons, submit and reset buttons, hidden fields, file download, and image buttons.
- *SELECT contain one or more OPTION elements: used for single or multi-selection menus.
- *TEXTAREA define multi-line text fields. Content used to initialize the field.