Open In App

HTML <kbd> Tag

It is a phrase tag and used to define the keyboard input. The text enclosed within <kbd> tag is typically display in the browser’s default monospace font.

Syntax:

<kbd> text content ... </kbd>

List of all phrase tag: 
 

Example 1: This example describe the use of <kbd> tag.




<!DOCTYPE html>
<html>
 
<body>
    <h1>GeeksforGeeks</h1>
 
    <h3>HTML kbd Tag</h3>
 
     
<p>
        Open a new window using the
        keyboard shortcut
        <kbd>Ctrl</kbd> + <kbd>N</kbd>
    </p>
 
</body>
 
</html>

Output: 
 

Example 2: This example using <kbd> tag with some CSS styles.




<!DOCTYPE html>
<html>
 
<head>
    <style>
        kbd {
            border-radius: 2px;
            padding: 2px;
            border: 1px solid black;
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
 
    <h2>HTML kbd Tag</h2>
 
     
<p>Open a new window using the
        keyboard shortcut
        <kbd>Ctrl</kbd>+<kbd>N</kbd>
    </p>
 
</body>
 
</html>

Output:

Supported Browsers: 


Article Tags :