HTML Kbd Tag

HTML <kbd> Tag Learn HTML <kbd> Tags in this blog. The HTML <kbd> Tag refers to a piece of inline text that represents user keyboard input, voice input, or any…

2 min read

HTML <kbd> Tag

Learn HTML <kbd> Tags in this blog. The HTML <kbd> Tag refers to a piece of inline text that represents user keyboard input, voice input, or any other text entry device input.

The HTML <kbd> Tag renders in the default monospace font on the text browser. It is used when the document needs to display text that the user must enter exactly from its keyboard.

Example:-

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        HTML kbd Tag
    </title>
</head>
<body>

<h1>This is HTML kbd Tag Example</h1>
<p>Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy text (Windows).</p>

<p>Press <kbd>Cmd</kbd> + <kbd>C</kbd> to copy text (Mac OS).</p>
</body>
</html>

Output:-

kbd

Tip: This tag is not disliked. However, it is possible to achieve a rich effect using CSS (see example below).

HTML <code> Tag

HTML <samp> Tag

HTML <var> Tag

HTML <pre> Tag

HTML <kbd> Tag

Khushal

Welcome to my corner of the web! I'm Khushal Tank, a passionate web developer and the author behind MyProgramming.com. With a robust background in PHP, Webflow, HTML, CSS, and JavaScript, I've dedicated myself to crafting seamless, interactive, and visually appealing websites.

2 thoughts on “HTML Kbd Tag

Leave a Reply

Your email address will not be published. Required fields are marked *