Home > Abakada: Back to Basics > Language References > HTML Elements > TT Element
Renders text in a fixed-width font. | HTML 2, 3.2, 4, 4.01 Deprecated |
HTML Syntax
<tt
class = classname
id = value
style = css_style_rules
title = text
>
NOTE: Both start and end tags are required.
The tt element displays a portion of text in teletype style font.
The element is similar in function to the <code>, <kbd> and <samp> elements, that render text in the browser’s default fixed-width font.
tt is used for inline formatting. For sections of code samples where block formatting is important, use the <pre> element to preserve the space characters and line breaks used in the code structure.
NOTE: This element has been deprecated and is no longer recommended.
The <tt>
element has no attribute of its own, but supports global attributes common to all HTML elements.
The following shows how the tt element may be used.
<p>This paragraph has <tt>some plain text</tt>.</p>
which would render on a Web page as
This paragraph has some plain text.
CODE KBD PRE SAMP XMP