HTML <tt> Tag

The <tt> tag defines text to be displayed in monospace or fixed-width font as it would appear on a teletype or typewriter.

The <tt> tag is obsolete in HTML 5.

Instead of the <tt> tag use CSS font-family property or appropriate HTML elements: the <kbd> element for keyboard input; the <var> tag for variables; the <code> tag for computer code; and the <samp> element for computer output.

Syntax

The <tt> tag comes in pairs. The content is written between opening (<tt>) and closing (</tt> ) tags.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <p>This is an ordinary text.</p>
    <p style="font-family: monospace">And this is a teletype text.</p>
  </body>
</html>

Result

Attributes

The <tt> tag supports the Global Attributes.

Browser support