Tutorials References Menu

HTML <tt> Tag


Not Supported in HTML5.

The <tt> tag was used in HTML 4 to define teletype text.


What to Use Instead?

Consider the <kbd> element (for keyboard input), the <var> element (for variables), the <code> element (for computer code), the <samp> element (for computer output), or use CSS instead.

Example

Define a teletype/monospace font for a <p> element (with CSS):

<p style="font-family:'Lucida Console', monospace">This text is monospace text.</p>
Try it Yourself »

In our CSS tutorial you can find more details about specifying the type of font in a document.