Re: Marking up keyboard shortcuts

Giganews Newsgroups
Subject: Re: Marking up keyboard shortcuts
Posted by:  Jukka K. Korpela (jkorpe…
Date: Thu, 2 Sep 2004

Spartanicus <…> 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
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.

Pages about Web authoring:



In response to

Marking up keyboard shortcuts posted by Spartanicus on Thu, 02 Sep 2004