Example

A simple <kbd> tag:

Laboratory

description & Usage

The <kbd> tag is used to denote text as keyboard input.

Browsers use a monospace font for the content inside this tag.

Related tags to <kbd>:

description tag

Display computer code

font-family: monospace

<code>

Display computer code output

font-family: monospace

<samp>

 

Show keyboard buttons

font-family: monospace

<kbd>

 

Display variable and mathematical expression

font-style: italic

<var>

 

Pre-formatted text

font-family: monospace

There are other default styles

<pre>

 

 

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
<kbd>

Global Attributes

The <kbd> tag supports the HTML Global Attributes.

Event Attributes

The <kbd> tag supports the HTML Event Attributes.

More Examples

Example

use CSS with <kbd> tag:

Laboratory

Default CSS

Most browsers will display the <kbd> tag with the following default style: