Text Level Elements


These don't cause paragraph breaks. Text level elements that define character styles can generally be nested. They can contain other text level elements but not block level elements.

Font style elements

These all require start and end tags, e.g.

  This has some <B>bold text</B>.
TT teletype or monospaced text
The quick red fox jumped over the lazy brown dog.
I italic text style
The quick red fox jumped over the lazy brown dog.
B bold text style
The quick red fox jumped over the lazy brown dog.
U underlined text style
The quick red fox jumped over the lazy brown dog.
STRIKE strike-through text style
The quick red fox jumped over the lazy brown dog.
BIG places text in a large font
The quick red fox jumped over the lazy brown dog.
SMALL places text in a small font
The quick red fox jumped over the lazy brown dog.
SUB places text in subscript style
The foxred jumped over the dogbrown.
SUP places text in superscript style
The foxquick jumped over the doglazy.

Phrase Elements

These all require start and end tags, e.g.

  This has some <EM>emphasized text</EM>.
EM basic emphasis typically rendered in an italic font
The quick red fox jumped over the lazy brown dog.
STRONG strong emphasis typically rendered in a bold font
The quick red fox jumped over the lazy brown dog.
DFN defining instance of the enclosed term
The quick red fox jumped over the lazy brown dog.
CODE used for extracts from program code
The quick red fox jumped over the lazy brown dog.
SAMP used for sample output from programs, and scripts etc.
The quick red fox jumped over the lazy brown dog.
KBD used for text to be typed by the user
The quick red fox jumped over the lazy brown dog.
VAR used for variables or arguments to commands
The quick red fox jumped over the lazy brown dog.
CITE used for citations or references to other sources
The quick red fox jumped over the lazy brown dog.

Form fields

INPUT, SELECT and TEXTAREA

INPUT elements are not containers and so the end tag is forbidden. INPUT, SELECT and TEXTAREA are only allowed within FORM elements. INPUT can be used for a variety of form fields including

SELECT elements require start and end tags and contain one or more OPTION elements. SELECT elements are used for single or multi-selection menus. TEXTAREA elements require start and end tags, and are used to define multi-line text fields. The content of the element is used to initialize the field.

Special Text level Elements

Anchors, IMG, APPLET, FONT, BR and MAP.

The A (anchor) element

Used to define hypertext links and also to define named locations for use as targets for hypertext links, e.g.

  The way to <a href="kamasutra.html">happiness</a>.

The attributes are: NAME, HREF, REL, REV and TITLE. HREF is used to supply a URL identifying the linked document or image etc. NAME is used to associate a name with this part of a document for use with URLs that target a named section of a document. Anchors can't be nested.

IMG

e.g.  <IMG SRC="canyon.gif" ALT="Grand Canyon">

Used to insert images. This is an empty element and so the end tag is forbidden. The attributes are: SRC, ALT, ALIGN, WIDTH, HEIGHT, BORDER, HSPACE, VSPACE, USEMAP and ISMAP. Images can be positioned vertically relative to the current textline or floated to the left or right. See BR with the CLEAR attribute for control over textflow.

APPLET

Requires start and end tags. This element is supported by all Java enabled browsers. It allows you to embed a Java applet into HTML documents, e.g. to include an animation. The contents of the element are used as a fallback if the applet can't be loaded. The attributes are: CODE, CODEBASE, NAME, ALT, ALIGN, WIDTH, HEIGHT, HSPACE and VSPACE. APPLET uses associated PARAM elements to pass parameters to the applet.

FONT

Requires start and end tags. This allows you to change the font size and/or color for the enclosed text. The attributes are: SIZE, COLOR. Colors are given as RGB in hexadecimal notation or as one of 16 widely understood color names.

BR

Used to force a line break. This is an empty element and so the end tag is forbidden. The CLEAR attribute can be used to move down past floating images on either margin, e.g. <BR CLEAR=LEFT>.

MAP

Requires start and end tags. This allows you to define client-side image maps. MAP elements contain one or more AREA elements that specify hotzones on the associated image and bind these hotzones to URLs.