Revision 81428 of <tt>

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

Revision Content

{{ obsolete_header() }}

Summary

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>
<h2 id="Summary">Summary</h2>
<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>
<h2 id="DOM Interface">DOM Interface</h2>
<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>
<h2 id="Example">Example</h2>
<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>
<h3 id="Result">Result</h3>
<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>
<h2 id="Notes" name="Notes">Notes</h2>
<ul> <li>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.</li> <li>Although this element was not deprecated in the HTML 4.01 specification, its use is discouraged in favor of style sheets.</li>
</ul>
<h2 id="See_also" name="See_also">See also</h2>
<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