HTML <tt>  Definition, Usage and Examples

The <tt> HTML Tag represents inline text that is shown with the user agent’s default monospace font face This element was designed to render text as it would appear on a fixed-width display, such as a teletype, text-only screen, or line printer. Non-proportional, monotype, and monospace are phrases that are used interchangeably and have the same broad meaning: they describe a typeface with characters that are all the same number of pixels wide. This element, however, is no longer in use. For inline text that has to be displayed in monospace type, use the more semantically useful <code>, <kbd>, <samp>, or <var> HTML Tag, or the <pre> tag for information that needs to be presented as a distinct block. The <tt> HTML Tag is part of Formatting HTML category in HTML Element Reference. There is only one attribute for the <tt> HTML Tag which is the global attributes.

<tt> code block example to learn how it works is given below. 

<tt> Contents... </tt>

The second example usage of the “<tt>” code block example is given below. 

<html>
    <body>
        <h1>facebook.com</h1>
        <h2>tt Tag</h2>
       <!-- HTML tt Tag is used here-->
       <tt>FB stands for Facebook</tt>
<p><tt>Social media post from facebook</tt></p>
    </body>
</html>        

What is <tt>  HTML Tag?

The acronym for teletype text is the <tt> HTML Tag. HTML 5 deprecated this tag. It was used to indicate keyboard input. It was mostly used for formatting. This element was introduced in HTML 4.

How to Use <tt>  HTML Tag?

To use the <tt> HTML Tag, The site developer should write <tt></tt> between the start and end tags, to show text entered into, and output by, a terminal application.

Example Usage of <tt>  HTML Tag?

The following example of usage of <tt> HTML tag is given below. 

<p>Enter the following at the mobile data command prompt: <code>set dataon</code><br/>
The mobile data client should display: <tt>Data is on</tt></p>

What are the Attributes of <tt>  HTML Tag?

There are is only one attribute for the <tt> HTML Tag which is the Global Attributes. The <tt> HTML Tag supports Global Attributes. All HTML elements, even those not specified in the standard, can have global attributes. This means that any non-standard elements must nevertheless allow certain characteristics, even if using such elements makes the content non-HTML5 compliant.

What are the Default CSS Settings for <tt>  HTML Tag?

The following is the Default CSS Setting for the <tt> HTML Tag.

tt {
  font-family: "Lucida Console", "Menlo", "Monaco", "Courier",
               monospace;

What are the Related other HTML Tags to <tt>?

The other related HTML Tags to the <tt> HTML Tag are listed below. 

  • <big> HTML Tag: The <big> HTML Tag is related to <tt> HTML Tag because they are both in formatting HTML Tags. The <big> HTML Tag is used to define large text.
  • <blockquote> HTML Tag: The <blockquote> HTML Tag is related to <tt> HTML Tag because they are both in formatting HTML Tags. The <blockquote> HTML Tag is used to include quotations from other sources.
  • <b> HTML Tag: The <b> HTML Tag is related to <tt> HTML Tag because they are both in formatting HTML Tags. The <b> HTML Tag is used to indicate that the text is bold.
  • <address> HTML Tag: The <address> HTML Tag is related to <tt> HTML Tag because they are both in formatting HTML Tags. The <address> HTML Tag is used to specify the author of a website or document’s contact information.
  • <bdi> HTML Tag: The <bdi> HTML Tag is related to <tt> HTML Tag because they are both in formatting HTML Tags. The <bdi> HTML Tag is used to create text that is written in a different direction than the rest of the text.
Holistic SEO
Follow SEO

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.