HTML Tags Reference

Back to Index

Document

Tag

Attribute

Description

<html> html document indication
<head> document head
<title> title (placed within head tags)
<meta> instruction to browser (placed within head tags)
<body> document body
background image in background
bgcolor background colour
text text colour
link colour of links
alink colour of link when activated
vlink colour of link after visited
topmargin margin at top of page
<h1> to <h6> headings
<!----> comment (doesn't appear on page)
<address> contact name

Paragraph

Tag

Attribute

Description

<p> paragraph
<br> line break
<hr> horizontal rule
width width in percent or pixels
size thickness in pixels
<pre> preformatted text
<blockquote> blockquote
<center> centres text and images

Character

Tag

Description

<b>bold
<i>italic
<tt>teletype
<em>emphasis
<strong>more emphasis
<cite>citation
<var>variable
<code>code
<samp>sample
<kbd>keyboard
<key>keyword
<dfn>definition
<strike>strike through
<blink>blinks on and off

List

Tag

Attribute

Description

<li>list item
typeA for uppercase, a for lowercase, i for Roman numerals
<ul>unnumbered list
<ol>ordered list
<menu>menu list
<dir>directory list
<dl>description list
<dt>data term
<dd>data description

Anchor

Tag

Attribute

Description

<a>anchors link
hrefdestination of link
nameplace in linked document
targetdetermines which document is loaded into a frame

Image

Tag

Attribute

Description

<img>imports image
srchref for image
alignaligns text to image (top, middle, bottom)
alttext alternative
borderputs border around image
heightheight of image in pixels
widthwidth of image in pixels
hspaceamount of horizontal space around image
hspaceamount of vertical space around image
usemapdirection to use imagemap named in map tag
ismapdirection to use map file

Imagemaps

Tag

Attribute

Description

<map>specifies "hot spots" for client-side imagemap
namenames an imagemap
<area>specifies area of "hot spots"
shaperect or circle
coordscoordinates of "hot spot"

Font

Tag

Attribute

Description

<font>customizes font appearance
facespecifies font type
colorspecifies font color
sizespecifies font size (-6 to +6)

Table

Tag

Attribute

Description

<table>defines table
borderborder for rows and cols
cellpaddingthickness of cell wall
cellspacingspaces between border and cell contents
bgcolorsets background colour of cells
<tr>end/start of row
<td>defines cell
colspanwidth of column
rowspanheight of row
alignalignment in cell
nowrapno text wrapping
<th>defines table heading
colspanwidth of column
rowspanheight of row
alignalignment in cell
nowrapno text wrapping
<caption>text outside table

Frame

Tag

Attribute

Description

<frame>defines single frame in frameset
namenames a frame
marginwidthhorizontal margin space
marginheightverticle margin space
noresizecan't be resized by user
scrollingset to yes, no or auto
srcdisplays document in frame
<frameset>used in place of body tag
rowsdetermines frame width in percent or pixels
colsdetermines frame height in percent or pixels

Form

Tag

Attribute

Description

<form>defines form
actionpoints to script
methodhow data stored
<input>
typetype of input field
<textarea>
rowsheight of text area
colswidth of text area
namevariable name
<select>
namevariable name
sizenumber of items
multiplemultiple selection
<option>
selecteddefault selection

Return to top of page