DEV Community

Cover image for HTML tags | kbd
Carlos Espada
Carlos Espada

Posted on • Edited on

2 1

HTML tags | kbd

It is used to represent the input of text by the user through a keyboard, by voice or using any other similar device.

It can be used in combination with the <samp> tag to represent various forms of text input and output:

  • Nest a <kbd> inside another <kbd>
<p>You can also create a new document using the keyboard shortcut <kbd><kbd>Ctrl</kbd> + <kbd>N</kbd></kbd>.</p>
Enter fullscreen mode Exit fullscreen mode
  • Nest a <kbd> inside a <samp>
<p>If a syntax error occurs, the tool will output the initial command you typed for your review:</p>
<blockquote>
  <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp>
</blockquote>
Enter fullscreen mode Exit fullscreen mode
  • Nest a <samp> inside a <kbd>
<p>To create a new file, choose the menu option <kbd><kbd><samp>File</samp></kbd>⇒<kbd><samp>New Document</samp></kbd></kbd></p>
<p>Don't forget to click the <kbd><samp>OK</samp></kbd> button to confirm once you've entered the name of the new file.</p>
Enter fullscreen mode Exit fullscreen mode

Normally browsers render them using their default monospaced font, although you can customize the style using CSS.

  • Type: inline
  • Self-closing: No
  • Semantic value: No

Definition and example | Support

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay