Warning:
This wiki has been archived and is now read-only.
Elements/kbd
From HTML Wiki
< Elements
Contents
<kbd>
The <kbd> element represents user input.
Point
- Example of user input:
- keyboard input
- voice commands ...
- 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. [Example B]
HTML Attributes
See global attributes.
Examples
Example A
[try it]
<p>Please, input "<kbd>Yes</kbd>" or "<kbd>No</kbd>"</p>
Example B
Represents an actual key [try it]:
<p>Please, press <kbd><kbd>Shift</kbd>+<kbd>A</kbd></kbd></p>
HTML Reference
The HTML5 specification defines the <kbd> element in 4.6.14 The kbd element.