By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,084 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,084 IT Pros & Developers. It's quick & easy.

Marking up keyboard shortcuts

P: n/a
Some use the kbd element (Example: <kbd>Ctrl</kbd>+<kbd>G</kbd>) to mark
up keyboard shortcuts, but the spec defines kbd as: "Indicates *text* to
be entered by the user." (emphasis mine).

UA support aside, what's the best way to do this?

--
Spartanicus
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Spartanicus <me@privacy.net> wrote:
Some use the kbd element (Example: <kbd>Ctrl</kbd>+<kbd>G</kbd>) to
mark up keyboard shortcuts, but the spec defines kbd as: "Indicates
*text* to be entered by the user." (emphasis mine).


The concept of "text" is somewhat vague, and it might be argued that
Ctrl G (i.e., BELL, or U+0007) is a character of "text" in a broad sense,
and "Ctrl+G" is one way of referring to it, so
<kbd>Ctrl+G</kbd>
would be OK.

But as you surely know, it's not a big issue in practice, since browsers
generally just render <kbd> in teletype font and leave it at that. If
you, as an author, wish to add (additional) style rules to distinguish
user input from other data, then <kbd> is convenient - but you can handle
things without it, too.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.