kbd is an HTML tag that is used to specify text to be typed in by the user (usually on a keyboard). While seldom used, this tag is useful for writing documentation for computer users. While the tag usually renders text by displaying it in a monospaced font, the tag should not be used simply for this purpose.

See also: code, font, plaintext, pre, samp, tt, var

Attributes

The kbd tag does not have any required HTML attributes. It does, however have numerous allowable attributes including:

Usage

To use the kbd tag, simply place opening and closing HTML tags around the characters that should be entered by the user. For example:

To destroy the usefulness of your computer, type <kbd>del C:\*.* /S /Q</kbd> at the command prompt.

On browsers that support this tag, this will typically cause the phrase "del *.* /S /Q" to be displayed in a monospaced font. Keep in mind that the purpose of this tag is to specify text to be typed in by the user, not to format your text. If you simply want to use a teletype font, you should technically use Cascading Style Sheets or the pre tag, however there are also the deprecated plaintext, samp, and tt tags that will do this as well.

Everything2 Support?

E2 does provide limited support for the kbd tag. It does not allow the use of any of its HTML attributes. Below is how your browser displays the example above here on Everything2:

To destroy the usefulness of your computer, type del C:\*.* /S /Q at the command prompt.

If you would like to use this tag with any of its attributes, you can do so in your Notelet Nodelet.

Common Browser Implementations*

Most web browsers support this tag, as it has been around since HTML 2.0. Most browsers will display the specified text in a monospaced font such as Courier New, but are not required to do so.

Previous HTML Tag: isindex (previous E2 supported HTML tag: ins)
Next HTML Tag: label (next E2 supported HTML tag: li)
See Also: HTML tags and HTML attributes


* Please feel free to send me information about how other browsers implement this tag.

Log in or register to write something here or to contact authors.