VOOZH about

URL: https://www.geeksforgeeks.org/html/html-tt-tag/

⇱ HTML <tt> Tag - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <tt> Tag

Last Updated : 11 Jul, 2025

The <tt> tag in HTML stands for teletype text. It was used in HTML 4 to define text in a monospaced, teletype-style font. However, the tag has been deprecated in HTML5 because it only served a presentational purpose without adding any semantic meaning to the content.

Instead of using <tt> tag, achieve the same result by using CSS to apply a monospaced font to the text. The font-family property is used to set a monospaced font, such as Courier, Courier New, or monospace

Syntax

<tt> Content will displayed in a monospaced font</tt>

Instead of using the <tt> tag, HTML5 provides semantic elements like:

  • <kbd>: Represents user input, like keyboard strokes.
  • <var>: Represents a variable in programming or math.
  • <code>: Represents a fragment of computer code.
  • <samp>: Represents sample output from a program or system.
Comment