HTML <tt> Tag

The HTML <tt> tag is not supported in HTML5. It was earlier used to specify a particular text in a monospaced font or fixed-width font. It thus displays the text on the browser as a teletype, text-only screen, or line printer.

The below tags can be used in HTML5 instead of the <tt> tag:

Tag Uses
<code> To specify a piece of computer code.
<samp> To specify a sample output from a computer program.
<kbd> To specify a keyboard input.
<var> To specify a variable.


<!DOCTYPE html>
<p>HELLO WORLD!!</p>
<p><tt>HELLO WORLD!!</tt></p>


In the above example, we have displayed the use of the HTML <tt> tag.

Supporting Browser:

Chrome, IE, Firefox, Opera, and Safari.