HTML kbd Tag is used to define the keyboard input, voice input or any textual input from any other device. The content of kbd tag is usually rendered in monospace font.
Table of Contents
Syntax of HTML kbd Tag
The Syntax of HTML kbd Tag is shown below, It has both starting tag and ending tag.
<kbd>Enter</kbd>
Usage of HTML kbd Tag
HTML kbd Tag is used for the keyboard input or keyboard keys like Enter key, Ctrl key etc. Most browsers display the text written inside kbd tag in monospace font.
Other than keyboard keys kbd tag is also used for other types of textual user input or voice input.
HTML kbd Tag is an inline element.
Example of HTML kbd Tag
Simple example of HTML kbd Tag is shown below.
<p>Please press <kbd>Ctrl</kbd> + <kbd>F5</kbd> to refresh the page.</p>
Output
Please press Ctrl + F5 to refresh the page.
In above example Ctrl and F5 are two keyboard keys. That is why we have put them inside the kbd tag.
Browser Support for HTML kbd Tag
HTML kbd Tag is supported by all major browsers including Safari and Internet Explorer.
Global Attributes Support in HTML kbd Tag
The HTML kbd Tag supports all Global Attributes.
Event Attributes Support in HTML kbd Tag
The HTML kbd Tag supports all Event Attributes.
HTML kbd Tag Video
Watch our video on HTML kbd Tag.