HTML - <tt>

The HTML Teletype Text Element (<tt>) produces an inline element displayed in the browser's default monotype font. This element was intended to style text as it would display on a fixed width display, such as a teletype. It probably is more common to display fixed width type using the <code> element.

Example

 

HTML
<p>Enter the following at the telnet command prompt: <code>set localecho</code><br />

The telnet client should display: <tt>Local Echo is on</tt></p>

Result

Enter the following at the telnet command prompt: set localecho
The telnet client should display: Local Echo is on

Description  

The HTML Teletype Text Element (<tt>) produces an inline element displayed in the browser's default monotype font. This element was intended to style text as it would display on a fixed width display, such as a teletype. It probably is more common to display fixed width type using the <code> element.

This element is obsolete. Use a more appropriate element, such as <code> or <span> with CSS, instead.

Notes  

  • A CSS rule can be defined for the tt selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.
  • Although this element was not deprecated in the HTML 4.01 specification, its use is discouraged in favor of style sheets.

See Also  

 

This element implements the HTMLElement interface.

Implementation note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element.

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/html/element/tt

Element Élément HTML Obsolete Reference Référence Web