Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html

What is the <kbd> element in HTML?

Sheza Munir

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The <kbd> element in HTML can be used to display keyboard input.

Display

The text enclosed within <kbd> and </kbd> is displayed in the browser’s default monospace font.

Example

Use this tag to display “Ctrl+C” in the following way: Ctrl+C

Attributes

The <kbd> tag supports global attributesattributes common to all HTML elements (e.g., class, id, lang, title, etc.) and #key# event attributes: these are attributes connected to action events, e.g., mouse clicks, mouse movements, etc.

The <kbd> element can also be styled using CSS.

Code

The following example shows how the <kbd> tag is used.

RELATED TAGS

html

CONTRIBUTOR

Sheza Munir
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring