<tt>

  • Revision slug: HTML/Element/tt
  • Revision title: tt
  • Revision id: 81427
  • Created:
  • Creator: Ms2ger
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

{{ obsolete_header() }}

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.

DOM Interface

This element implements the HTMLElement interface.

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

Example

   <p>Enter the following at the telnet command prompt: <kbd>set localecho</kbd><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

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

{{ HTML:Element_Navigation() }}

{{ languages( { "pl": "pl/HTML/Element/tt" } ) }}

Revision Source

<p>{{ obsolete_header() }}</p>
<p>The HTML Teletype Text Element (<span style="font-family: Courier New;">&lt;tt&gt;</span>) 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 &lt;code&gt; element.</p>
<div class="note">This element is obsolete. Use a more appropriate element, such as <code>code</code> or <code>span</code> with CSS, instead.</div>
<h3 class="editable">DOM Interface</h3>
<p>This element implements the <code><a href="/en/DOM/element" title="en/DOM/element">HTMLElement</a></code> interface.</p>
<div class="note">
<p><strong>Implementation note: </strong>up to Gecko 1.9.2 inclusive, Firefox implements the <a href="/en/DOM/span" title="en/DOM/span"><span style="font-family: Courier New;">HTMLSpanElement</span></a> interface for this element.</p>
</div>
<h3 name="Example">Example</h3>
<pre class="eval">   &lt;p&gt;Enter the following at the telnet command prompt: &lt;kbd&gt;set localecho&lt;/kbd&gt;&lt;br /&gt;
   The telnet client should display: &lt;tt&gt;Local Echo is on&lt;/tt&gt;&lt;/p&gt;
</pre>
<h4 name="Result">Result</h4>
<p>Enter the following at the telnet command prompt: <code>set localecho</code><br>
The telnet client should display: <code>Local Echo is on</code></p>
<h3 name="Notes">Notes</h3>
<p>A CSS rule can be defined for the <code>tt</code> selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.</p>
<p>Although this element was not deprecated in the HTML 4.01 specification, its use is discouraged in favor of style sheets.</p>
<h3 name="See_also">See also</h3>
<ul> <li><a href="/en/HTML/Element/code" title="en/HTML/Element/code">HTML Code Element</a></li> <li>HTML 4.01 Specification: <a class="external" href="http://www.w3.org/TR/html4/present/graphics.html#h-15.2">Font Styles</a></li>
</ul>
<p>{{ HTML:Element_Navigation() }}</p>
<p>{{ languages( { "pl": "pl/HTML/Element/tt" } ) }}</p>
Revert to this revision