HTML kbd tag

HTML <kbd> tag is for keyboard input. Actually it was made for the user input or keyboard input style. The font family of kbd input is monospace.

<p>To get the result Press <kbd> <kbd>Ctrl</kbd> + <kbd>r</kbd> </kbd></p>
 <p><kbd> This input looks as it has been echoed by the system. </kbd></p>
</>

To get the result Press Ctrl + r

This input looks as it has been echoed by the system.

Tag Uses

Specific uses of <kbd> tag

kbd element may also be nested another kbd element to represent input key.

<p> To copy the text just select by pressing <kbd> <kbd>Ctrl</kbd> + <kbd>a</kbd> </kbd>. <p>
<p> And then press <kbd> <kbd>Ctrl</kbd> + <kbd>c</kbd> </kbd>. </p>

Try</>

Kbd element may also be used in combination with samp to represent system input or a file name.

<p>To access the downloaded videos go to download <kbd><samp>Floder</samp></kbd> and then open videos <kbd><samp>Floder</samp></kbd>. </p>

Try</>

Tag omission

Both the opening and closing tags are necessary for the kbd element.

Global Attributes

All the global attributes are applicable on the kbd element.



Was this article helpful?