<kbd> Tag Syntax
Rules for coding HTML kbd
elements
<body> ... ... phrasing content expected ...<kbd>... phrasing content ...</kbd>... ... </body>
Rules for coding HTML kbd
elements
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Code the kbd element to indicate keyboard input where phrasing content is expected.
- Begin the kbd element with a starting <kbd> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Include any HTML global attributes on the <kbd> tag as appropriate.
- Inside the kbd element, between the starting
<kbd>
tag and the ending</kbd>
tag, code the inner HTML phrasing content. - End the kbd element with a matching
</kbd>
closing tag.
Content Model
Content of the kbd element
The content of the kbd element can include HTML comments, text content and only those HTML tags that can be used in phrasing content.