Home > Abakada: Back to Basics > Language References > HTML Elements > KBD Element
Renders text in a fixed-width font. | HTML 2, 3.2, 4, 4.01, 5 |
HTML Syntax
<kbd
class = classname
id = value
style = css_style_rules
title = text
>
NOTE: Both start and end tags are required.
The <kbd
> element displays text in a special font that is meant to indicate that the user should type the text on the keyboard.
The element is similar in function to the <code> and <samp> elements, that render text in the browser’s default fixed-width font.
kbd is used for inline formatting. For sections of code samples where block formatting is important, use the <pre> element to preserve the space characters and line breaks used in the code structure.
The <kbd>
element has no attribute of its own, but supports global attributes common to all HTML elements.
The following shows how the kbd element may be used.
<p>This paragraph is rendered in the normal page font.
<p>This one shows <kbd>the effect of using the <b>kbd</b> element</kbd>.
which would render on a Web page as
This paragraph is rendered in the normal page font.
This one shows the effect of using the kbd element.
CODE PRE SAMP TT XMP