HTML <kbd> Tag


Examples

Format text in a document:

<kbd>Keyboard input</kbd>

Try it Yourself »

Browser Support

Element
<kbd> Yes Yes Yes Yes Yes

Tag Definition and Usage Instructions

The <kbd> tag defines keyboard text style.

The HTML keyboard input element (<kbd>) is used to represent user input. It produces an inline element displayed in the browser's default monospace font.

Tip:It is not recommended to use the <kbd> tag; it is better to use CSS to achieve rich effects.

All Phrase Tags:

Tag Description
<em> Rendered as emphasized text.
<strong> Defines important text.
<dfn> Defines a definition item.
<code> Defines computer code text.
<samp> Defines sample text.
<kbd> Defines keyboard text. It indicates that the text is typed from the keyboard. It is often used in computer-related documents or manuals.
<var> Defines a variable. You can use this tag together with the <pre> and <code> tags.

More Examples


Example

Format text in a document:

<p>Enter in the dialog window:<kbd>cmd</kbd><br />Then click the OK button.</p> <p>Please use the shortcut key to save the file<kbd>Ctrl</kbd> + <kbd>S</kbd></p>

Try it Yourself »


Differences Between HTML 4.01 and HTML5

None.


Global Attributes

The <kbd> tag supports global attributes. View the complete attribute tableHTML Global Attributes。


Event Attributes

The <kbd> tag supports allHTML Event Attributes。


Related Articles

HTML Tutorial:HTML Text Formatting

Other Extensions