HTML - <tt> Tag



HTML <tt> tag is used to specify teletype text. This element was created to render text as it wolud be displayed on a fixed-width size display.

This tag is no longer recommended as it is deprecated and not supported in the HTML5. Instead you can use the <pre> , <kbd> tags.

Syntax

<tt> Content... </tt>

Attribute

HTML tt tag supports Global and Event attributes of HTML.

Examples of HTML tt Tag

Bellow examples will illustrate the usage of tt tag. Where, when and how to use tt tag to specifies teletype text.

Define teletype Text using tt Tag

Let's look at the following example, where we are going to use the <tt> tag to define teletype text.

<!DOCTYPE html>
<html>

<head>
   <title>HTML tt Tag</title>
</head>

<body>
   <p>tutorialspoint</p>
   <tt>learning website</tt>
</body>

</html>

Define teletype Text using other HTML Tags and CSS

In the following example we will create teletype text using <pre>, <kbd> and CSS property.

<!DOCTYPE html>
<html>

<head>
   <title>HTML tt Tag</title>
</head>

<body>
   <p>tutorialspoint</p>
   <p style="font-family:'Lucida Console', monospace">This text is monospace text.</p>
</body>

</html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
tt Yes 1.0 Yes 12.0 Yes 1.0 Yes 4.0 Yes 15.0
html_deprecated_tags.htm
Advertisements