MeshWorld India LogoMeshWorld.
TutorialHTML1 min read

An Intro to HTML <kbd> Tag

Listen to ArticleAI Speech
~1 min read narration
100%
An Intro to HTML <kbd> Tag

The <kbd> is an inline HTML element that defines keyboard input. By default it’s rendered with default monospace font.

With HTML, a reset button can be added in a form with <input /> tag. For that, we need to specify an attribute type with "reset" value as type="reset"

This tag is semantic solution to display keyboard inputs.

Example

<kbd>Alt</kbd>

Output

Alt


Applying CSS

kbd {
  padding: 0.2rem 0.4rem;
  color: #ffffff;
  background-color: #007bff;
  border-radius: 0.2rem;
}

Output

Press Ctrl + C to copy

It will be really helpful for documentation purposes. I have been using <code> tag till now. Will strongly adhere to this after encountering this semantic solution.


Dos

To paste copied item without formatting, the keyboard shortcut you can use:

<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd>

Don’ts

To paste copied item without formatting, the keyboard shortcut you can use:

<code>Ctrl</code> + <code>Shift</code> + <code>v</code>

<code>: Text indicating fragment of a computer code.

Hope you like this

Happy 😄 coding

With ❤️ from 🇮🇳

Reader Quality Feedback

Did this technical guide help solve your problem?

Suggest Errata ($0)
Vishnu
Primary Author

Vishnu

Founder & Principal Architect at MeshWorld. Senior engineer and instructor specializing in AI agent systems, scalable web architecture, and modern development workflows.

Explore Author Archive
Compute Fuel & Open Testbed
100% Independent & Verified

Fuel High-Density, Zero-Fluff Engineering Deep-Dives

Every guide on MeshWorld is validated on physical Linux nodes and reproducible testbeds. If this article saved you hours of debugging or unblocked production, consider funding our next cluster run.

Weekly Dispatch

Join MeshWorld Dispatch

Get practical tutorials, system blueprints, and curated AI engineering notes straight to your inbox. No fluff, zero spam.

Zero spam. 1-click unsubscribe anytime.Prefer RSS?
Curated Continuations

Up Next in This Domain.

Browse Full Archive