kbd

< html‎ | elements
Jump to: navigation, search

kbd

This article is In Progress.



Summary

The 'kbd element denotes user input. Typically this is keyboard input (hence "kbd"), but it may also be used to represent other user input, e.g. voice commands or gestures.


Overview Table

DOM Interface HTMLElement


Compatibility

Do you think this data can be improved? You can ask to add by opening an issue or make a pull request.

Desktop

FeaturesChromeFirefoxInternet ExplorerOperaSafari
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes

Mobile

FeaturesAndroidFirefox MobileIE MobileOpera MobileSafari Mobile
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes

Examples

This example uses the kbd element to convey a command line command to the user.

HTML

<p>Type the command <kbd>git status</kbd>
to see the working tree status.</p>

This example illustrates using kbd to indicate keystrokes.

HTML

<p>Press <kbd><kbd>Ctrl</kbd>+<kbd>s</kbd></kbd>
to save your document.</p>

Usage

The kbd element is a phrasing-level element. It must not contain block-level elements, but it can contain other phrasing-level elements.

Notes

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 (see Example 2).


Related specifications

Specification Status Related Changes
HTML 4.01 W3C Recommendation
HTML 5 W3C Candidate Recommendation

See also

Related articles

HTML


















































… further results

Text
















































  • kbd



… further results

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]