Working KEY Tag Element Example
Note: Since this file deals with a tag deleted prior to the introduction of
HTML 2.0, in order to make it validate I have written it to the standard of
HTML described herein. It cannot be validated by any current approved public
DTD accepted by the Web Consortium validator, but the validator can now
validate to any provided DTD, though it will provide warnings about the
Document Type not being in the validator's catalog.
In the DTD prepared by Dan Connolly in January 1993, the <HPn>
tags are done away with and finally replaced with what would pretty much become
the list of inline data type and formatting tags. Here is the list of new
inline formatting elements/tags introduced at that point:
- CITE - Used for citations of outside works, such as books or articles.
(Quoted from Moby Dick)
- CODE - Used for showing the raw source code for a single line of a computer
program source, which can be put inline in a paragraph. (
x = 2 * (y - 2);
)
- TT - Looks similar to CODE, but is more of a formatting tag which simply
specifies a monospaced font ("teletype text") without explanation. (And
then it printed error 1809: unfused generator)
- EM - Used to mark an emphasized phrase, often shown as italics. (Look in the
other box)
- KBD - Used to mark off a line of text for a user to enter in. (Then enter
run docscreen)
- KEY - Used to represent a key on the computer keyboard. (And press Enter)
- SAMP - Used to show an output sample of letters, uses a monospace font. (For
example, Ë produces Ë)
- STRONG - Used to mark off a strongly emphasized phrase, often shown as bold. (For
the umpteenth time, I will never do that)
- VAR - Used to indicate a variable name instead of an actual literal value,
often shown as italic, or italic and monospace.
(As they say, X marks the spot)
- DFN - Used to call attention to terms that are being introduced and defined
at a certain point in a document. (A Fireburger is an extremely...)
- I - Used for putting text in italics. (I use italics)
- B - Used for putting text in bold. (Additions in bold)
- U - used for giving text an underline. (This is not a link)
Of all of these there is one element/tag which did not last very long. And that
is the <KEY>
element. It exists in Dan Connolly's January
1993 DTD, the DTD for the first release of HTML 1, and can be optionally enabled
(with ugly SGML commands) for the second release of HTML 1. By HTML 2.0 it was
gone, never to be seen again.
Apparently, most browser developers neglected this element, perhaps because
of its seeming similarity to <KBD>
, which is in fact a very
different element. KBD has to do with some string of characters (keystrokes) that
the user or operator is to enter, but KEY is about describing a single key on the
terminal keyboard. It was intended for those multi-letter keys such as Ctrl or
Shift or Alt. Let us see here if your browser knows the KEY element:
<P>Press the <KEY>AltGr</KEY> key to enter letters with
diacritical marks on those keyboards that support them.</P>
Press the AltGr key to enter letters with
diacritics on those keyboards that support them.
Recommended Implementation
For compatibility to the early versions of HTML that defined this element,
it makes sense to display it in a manner similar to the style sheet example
included as part of this demonstration.
Upgrades and Downgrades
Possible downgrades are:
- None - This tag was introduced at the beginning of the use of HTML tags
to indicate various kinds of text.
Possible upgrades are:
- Key Tag with Style Sheets - Style sheets
can easily be used to provide a kind of distinctive look for such names of keys
that may be found on a computer keyboard.
This <KEY>
demonstration file, "htkey.html," is "HTML 0.h"
compliant.
The Style sheet demonstration file
"htkey1.html" is HTML 4.01 Transitional
compliant.
_________________________________________________________________
Next Level Up