HTML <kbd> Tag
To represent a user or keyboard input a voice command or similar inputs the HTML <kbd> element is used. It displays the contents in the browser’s default monospace font.
Example 1:
<!DOCTYPE html> <html> <body> <em>HELLO WORLD!!</em><br> <strong>HELLO WORLD!!</strong><br> <code>HELLO WORLD!!</code><br> <samp>HELLO WORLD!!</samp><br> <kbd>HELLO WORLD!!</kbd><br> <var>HELLO WORLD!!</var> </body> </html>
Explanation:
In the above example, we have used the different HTML phrase tags.
Example 2:
<!DOCTYPE html> <html> <body> <h2>HTML KBD Element</h2> <h4>Example:</h4> <p>Cut Data: <kbd>Ctrl + X</kbd></p> <p>Copy Data: <kbd>Ctrl + C</kbd></p> <p>Paste Data: <kbd>Ctrl + V</kbd></p> </body> </html>
Explanation:
In the above example, we are displaying the use of the HTML <kbd> tag.
Global Attributes:
All the Global attributes are supported by the HTML <kbd> tag.
Event Attributes:
All the Event attributes are supported by the HTML <kbd> tag.
Supporting Browsers:
Chrome, IE, Firefox, Opera, and Safari.