HTML <kbd> Tag

<p>On your Mac, save the document by pressing the <kbd><kbd>Command</kbd>+<kbd>S</kbd></kbd> keys.</p>

The above example demonstrates usage of the <kbd> element.

The <kbd> element represents user input. This is typically keyboard input, but it could also be other input, such as voice commands.

The W3C specifies the usage as follows:

When the <kbd> element is nested inside a <samp> element, it represents the input as it was echoed by the system.

When the <kbd> element contains a <samp> element, it represents input based on system output, for example invoking a menu item.

When the <kbd> element is nested inside another <kbd> element, it represents an actual key or other single unit of input as appropriate for the input mechanism.