HTML Tag


The <tt> element in HTML is used to set keyboard input. Since the element deprecated now, therefore use <kbd> instead.

Note: The <tt> tag is not supported in HTML.

Let us now see an example to implement the <tt> tag in HTML−

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
<h2>Shortcut Keys</h2>
<p>Use the following shortcut keys:</p>
<p><strong>Cut</strong>: <tt>CTRL</tt>+<tt>X</tt></p>
<p><strong>Copy</strong>: <tt>CTRL</tt>+<tt>C</tt></p>
<p><strong>Paste</strong>: <kbd>CTRL</tt>+<tt>V</tt></p>
<p><strong>Undo</strong>: <tt>CTRL</tt>+<tt>Z</tt></p>
</body>
</html>

Output

In the above example, we have set the shortcut keys using the <tt> element−

Paste</strong>: <kbd>CTRL</tt>+<tt>V</tt></p>

We have set one of the shortcut for pasting text as shown above −

CTRL + V

Updated on: 30-Jul-2019

34 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements