This Guide includes all the tags we have covered together with their attributes, arranged in logically related groups. Where the closing tag is shown in brackets, it is optional.
| Overall Structure | |
|---|---|
| <HTML>, </HTML> | Contains the entire HTML page. |
| <HEAD>, </HEAD> | Contains the Head section of the page, where the title and other information about the whole page is placed. |
| <BODY>, </BODY> | Contains the Body section of the page, where the actual text that
appears on the page is placed. bgcolor=colourname | #RGB value. Specifies background colour for page. text=colourname | #RGB value. Specifies default text colour for page. link=colourname | #RGB value. Specifies colour for an unvisited hypertext link. vlink=colourname | #RGB value. Specifies colour for a visited link. alink=colourname | #RGB value. Specifies colour for a link when mouse is over it. background=URL. Specifies background image (JPEG or GIF file). |
| <TITLE>, </TITLE> | Contains the title (placed in the head). |
| <!-- ...to... --> | All text between these symbols is treated as a comment, and ignored by the browser. |
| Page Layout | |
|---|---|
| <P>, (</P>) | Contains a paragraph. With no attributes the only effect is to
leave a gap between paragraphs. align=left | center | right |
| <P> <P> | Idiom to give extra vertical space between paragraphs. |
| <BR> | End-of-line break, without introducing a gap between
paragraphs. clear=none | left | right | all |
| <PRE>, </PRE> | Contains a section of preformated text, to be displayed as written, in a fixed width typeface. |
| <CENTER>, </CENTER> | Contains a section of text, to be centred horizontally in the browser window. |
| <HR> | Creates a horizontal ruled line across the page. width=pixels | percent% align=left | center | right size=pixels noshade |
| Logical Text Formatting | |
|---|---|
| <H1..H6>, </H1..H6> | Enclose a heading. H1 is the largest, H6 is the smallest align = left | center | right |
| <EM>, </EM> | Emphasised Text. (Usually displayed in italics.) |
| <STRONG>, </STRONG> | Strong Text. (Usually displayed in bold.) |
| <CODE>, </CODE> | Text is example of Code. (Displayed in fixed-width font.) |
| <ADDRESS>, </ADDRESS> | Text is an address. (Usually displayed in a small font.) |
| <CITE>, </CITE> | Text is a citation. (Usually displayed in italics.) |
| <Q>, </Q> | Text is a short quotation. cite=URL for hyperlink to source of quotation. |
| Physical Text Formatting | |
|---|---|
| <B>, </B> | Bold text. |
| <I>, </I> | Italic text. |
| <U>, </U> | Underlined text. |
| <S>, </S> | Strike text. (Text with a horizontal line through it.) |
| <SMALL>, </SMALL> | Small text. |
| <BIG>, </BIG> | Big text. |
| <SUB>, </SUB> | Subscript. |
| <SUP>, </SUP> | Superscript. |
| <TT>, </TT> | Teletype text. (Text displayed in a fixed-width font.) |
| <FONT>, </FONT> | Specifies a specific font colour, face and size. color=name | #RGB face=face1, face2, face3 etc. Will use first recognised font-name from the list. size=1 to 7 | +1 to +6 | -1 to -6 (1 is smallest, 7 is largest. With sign gives an increase or decrease relative to basefont). |
| <BASEFONT> | Specifies default font for the page. Attributes as for <FONT> tag. |
| Data Structures | |
|---|---|
| <OL>, </OL> | Ordered List. type=1 | i | I | a | A |
| <UL>, </UL> | Unordered List. type=disk | square | circle |
| <LI>, (</LI>) | List Item for Ordered and Unordered lists. |
| <TABLE>, </TABLE> | Contains a complete table. border=pixels (Defaults to 1 if attribute present, 0 if attribute absent.) bgcolor=name | #RGB width=pixels | percent% height=pixels | percent% cellpadding=pixels cellspacing=pixels |
| <TR>, (</TR>) | Table Row (Can be omitted for first row.) bgcolor=name | #RGB align=left | center | right (Default is left for a TD cell, center for a TH cell.) valign=top | middle | bottom (Default is middle.) |
| <TD>, (</TD>) | Table Data Cell bgcolor=name | #RGB width=pixels | percent% (Widest cell sets width for whole column.) height=pixels | percent% (Highest cell sets height for whole row.) colspan=number rowspan=number align=left | center | right (Default is left.) valign=top | middle | bottom (Default is middle.) |
| <TH>, (</TH>) | Table Heading Cell. (As for Table Data cell, except text is emboldened and default for align attribute is center.) |
| Images | |
|---|---|
| <IMG>, </IMG> | Inserts an Image src=URL Source file for image. (Should be in GIF or JPEG format.) border=pixels (Defaults to 1 if attribute present, 0 if attribute absent.) width=pixels height=pixels hspace=pixels vspace=pixels alt="Descriptive Text" align (Avoid using this attribute. Browsers are unpredictable in their behaviour. To align images, either use a <P> paragraph container with an align attribute, or place the image in a table cell.) |
| Hyperlinks | |
|---|---|
| <A>, </A> | Anchor. href=URL | #name | URL#name | mailto:emailaddress name=text |
| Entity Characters | |
|---|---|
| < and > | < and > |
| & | & |
| © or © | © |
| é and É | é and É Other accented letters follow same pattern. |
| | Non-breaking Space |
| π | π(Greek Pi, if your browser permits) |
| Copyright © Alan Simpson 2000 | Back to index. | Last Updated 2000-04-28 |