mozilla

Revision 81452 of <kbd>

  • Revision slug: HTML/Element/kbd
  • Revision title: kbd
  • Revision id: 81452
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 30 words added, 8 words removed

Revision Content

The HTML Keyboard Input Element (<kbd>) produces an inline element displayed in the browser's default monotype font. This element is used to identify user input.

DOM Interface

This element implements the HTMLElement interface.

Implementation note: up to Gecko 1.9.2 included, Firefox implements the HTMLSpanElement interface for this element.

Example

   Type the following in the Run dialog: <kbd>cmd</kbd><br />Then click the OK button.

Result

Type the following in the Run dialog: cmd
Then click the OK button.

Note

A CSS rule can be defined for the kbd selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.

See also

{{ HTML:Element_Navigation() }}

{{ languages( { "pl": "pl/HTML/Element/kbd" } ) }}

Revision Source

<p>The HTML Keyboard Input Element (<span style="font-family: Courier New;">&lt;kbd&gt;</span>) produces an inline element displayed in the browser's default monotype font. This element is used to identify user input.</p>
<h3 class="editable">DOM Interface</h3>
<p>This element implements the <code><a href="/en/DOM/element" title="en/DOM/element">HTMLElement</a></code> interface.</p>
<div class="note">
<p><strong>Implementation note: </strong>up to Gecko 1.9.2 included, Firefox implements the <a href="/en/DOM/span" title="en/DOM/span"><span style="font-family: Courier New;">HTMLSpanElement</span></a> interface for this element.</p>
</div>
<h3 name="Example">Example</h3>
<pre class="eval">   Type the following in the Run dialog: &lt;kbd&gt;cmd&lt;/kbd&gt;&lt;br /&gt;Then click the OK button.
</pre>
<h4 name="Result">Result</h4>
<p>Type the following in the Run dialog: <code>cmd</code><br>
Then click the OK button.</p>
<h3 name="Note">Note</h3>
<p>A CSS rule can be defined for the <code>kbd</code> selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.</p>
<h3 name="See_also">See also</h3>
<ul> <li><a href="/en/HTML/Element/code" title="en/HTML/Element/code">HTML Code Element</a></li> <li>HTML4 Specification: <a class="external" href="http://www.w3.org/TR/html4/struct/text.html#h-9.2.1">Phrase Elements</a></li> <li>HTML5 Specification: <a class=" external" href="http://www.whatwg.org/html/#the-kbd-element" title="http://www.whatwg.org/html/#the-kbd-element">The <code>kbd</code> element</a></li>
</ul>
<p>{{ HTML:Element_Navigation() }}</p>
<p>{{ languages( { "pl": "pl/HTML/Element/kbd" } ) }}</p>
Revert to this revision