HTML <tt>Tag -Not Supported in HTML5
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the <tt> tag.
Tag Definition and Usage
HTML5 does not support the <tt> tag. Use CSS instead.
The <tt> tag defines teletype text.
Tips and Notes
Tip:Use CSS to specify thetext type in the document.。
Differences Between HTML 4.01 and HTML5
HTML5 does not support the <tt> tag. HTML 4.01 supports the <tt> tag.
Standard Attributes
In HTML 4.01, the <tt> tag supports the following standard attributes:
| Attribute | Value | Description |
|---|---|---|
| class | classname | Defines the class name of the element. |
| dir | rtl ltr |
Defines the text direction of the content within the element. |
| id | id | Defines the unique id of the element. |
| lang | language_code | Defines the language code of the content within the element. |
| style | style_definition | Defines the inline style of the element. |
| title | text | Defines additional information about the element. |
| xml:lang | language_code | Defines the language code of the content within the element in an XHTML document. |
For a complete description, visitStandard Attributes。
Event Attributes
In HTML 4.01, the <tt> tag supports the following event attributes:
| Attribute | Value | Description |
|---|---|---|
| onclick | script | Script to be run when the mouse is clicked. |
| ondblclick | script | Script to be run when the mouse is double-clicked. |
| onmousedown | script | Script to be run when a mouse button is pressed down. |
| onmousemove | script | Script to be run when the mouse pointer moves. |
| onmouseout | script | Script to be run when the mouse pointer moves out of an element. |
| onmouseover | script | Script to be run when the mouse pointer hovers over an element. |
| onmouseup | script | Script to be run when a mouse button is released. |
| onkeydown | script | Script to be run when a key is pressed. |
| onkeypress | script | Script to be run when a key is pressed and then released. |
| onkeyup | script | Script to be run when a key is released. |
For a complete description, visitEvent Attributes。
Other Extensions