Widely availableSupported across all major browsers. Safe to use in production.

Overview

The <kbd> element represents textual user input, such as keyboard or voice input, styling text in monospaced type by default.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
≤4
18
≤3.2
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 1 item(s)
Implementation note
  • Before Firefox 4, creating a <kbd> element incorrectly resulted in an `HTMLSpanElement` object, instead of the expected `HTMLElement`.

Syntax

HTML
<p>To save, press <kbd>Ctrl</kbd> + <kbd>S</kbd>.</p>
<p>Press the <kbd>Enter</kbd> key to confirm.</p>

Live demo

ki-bo-dsho-tkat

Kbd element in ki-bo-dinput or sho-tkatki- display.

PreviewFullscreen

operationid

Kbd element in aprike-tion. operationorder Description.

PreviewFullscreen

kbd nested

Kbd nestedki-. combination representation.samp and. combination.

PreviewFullscreen

Use cases

  • Using <kbd>

    The <kbd> element represents textual user input, such as keyboard or voice input, styling text in monospaced type by default.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Verify how this element is announced by screen readers.

Powered by web-features