Skip to content

<kbd> - The Keyboard Input Element

Inline HTML 2.0

The keyboard input element represents user input from a keyboard, voice input, or any other text entry device. It’s typically displayed in a monospace font.

Result
<kbd>keyboard input</kbd>

The <kbd> element represents text that the user should type or input.

Result
Result
Result
Result
Result
Result
Result
Result

You can nest <kbd> elements to show key combinations:

Result
<!-- User keyboard/input -->
<p>Press <kbd>Enter</kbd> to continue.</p>

Customize keyboard input appearance:

Result
Result
Result
Result
Result
Result
Result

Combine with <samp> to show command and output:

Result

Screen readers may announce <kbd> content as keyboard input, helping users understand they should type this text.

<p>Hit the key to save.</p>

Provide alternatives for different operating systems:

<p>
Save:
<kbd>Ctrl</kbd>+<kbd>S</kbd> (Windows/Linux)
or <kbd></kbd>+<kbd>S</kbd> (Mac)
</p>
BrowserVersionNotes
Chrome1+Full support
Firefox1+Full support
Safari1+Full support
Edge12+Full support
IE3+Full support

The <kbd> element has been supported since the earliest browsers.