From Web Education Community Group
< HTML‎ | Elements
Revision as of 16:43, 22 November 2011 by Hiroki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


The <kbd> element represents user input.


  • 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.


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.