HTML <kbd> Tag
It is a phrase tag and used to define the keyboard input. The text enclosed within <kbd> tag is typically display in the browser’s default monospace font.
Syntax:
<kbd> text content ... </kbd>
List of all phrase tag:
Example 1: This example describe the use of <kbd> tag.
html
<!DOCTYPE html> < html > < body > < h1 >w3wiki</ h1 > < h3 >HTML kbd Tag</ h3 > < p > Open a new window using the keyboard shortcut < kbd >Ctrl</ kbd > + < kbd >N</ kbd > </ p > </ body > </ html > |
Output:
Example 2: This example using <kbd> tag with some CSS styles.
HTML
<!DOCTYPE html> < html > < head > < style > kbd { border-radius: 2px; padding: 2px; border: 1px solid black; } </ style > </ head > < body > < h1 >w3wiki</ h1 > < h2 >HTML kbd Tag</ h2 > < p >Open a new window using the keyboard shortcut < kbd >Ctrl</ kbd >+< kbd >N</ kbd > </ p > </ body > </ html > |
Output:
Supported Browsers:
- Google Chrome
- Edge 12 and above
- Internet Explorer
- Firefox 1 and above
- Safari
- Opera
Contact Us