Skip to: content, navigation

by Ian Lloyd

tt (HTML element)

Spec
Depr. Empty Version
No No HTML 2
Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full

Example

You might use tt to describe the output from an archaic sports scores system:

<p>The scores rolled in underneath the moustached face of Dickie
    Davies, hot off the teletype machines that someone was operating
    deep in the dungeons of ITV: &quot;<tt>Heart of Midlothian: 4,
    Queen of the South: 2, Plymouth Argyle 3 …</tt>&quot;</p>
Type
inline element
Contains
inline elements only
Contained by
block-level elements, inline elements

Description

Much like the b and i elements, tt provides no semantic information about the text it encloses—it is purely used for text formatting purposes. tt is short for teletype, and instructs the browser to render the text similarly to that produced by old-style teletype machines, which is understood to be a fixed-width (monospace) font. Most browsers will render tt content in Courier typeface.

Use This For …

It’s best not to use this element at all! While you may have text content that needs fixed width formatting, you’d be well advised to define a class in your CSS file, and style it using a monospace font.

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

The tt element has good browser support: all the major browsers render it in a fixed-width font, which is usually Courier.

Related Reading

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters