KEY Elememt/Tag Simulated With Style Sheets

Now let's see how <KEY> might be simulated using style sheets.

<P>Press the <SPAN CLASS="key">AltGr</SPAN> 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.

While we are at it, a couple other of the early text formatting tags have gone on to have a rather spotty existance. In particular, the underlining tag <U> was also declared in this early DTD, but vanished by the second release of HTML 1, was gone for HTML 2.0, came back with HTML 3.2 (and HTML 3.0 drafts), continued in HTML 4.01 (and HTML 4.0) albeit as a depreciated tag, continued thus into XHTML 1.0, and finally disappeared again with XHTML 1.1. Perhaps because the usual default manner of indicating a link is to place an underline on the linked text (as well as give it a different color). In any case, underline can be created with a style sheet if needed. See this example:

<P>No difference between this <U>underline</U> and this
<SPAN CLASS="und">underline</SPAN>.</P>

No difference between this underline and this underline.

The <DFN> also got lost in HTML 2.0, but promptly reappeared with HTML 3.2 (and HTML 3.0) and has remained ever since.

Finally, the second release of HTML 1 would introduce a <STRIKE> text formatting tag for strikeout text (to show what is to be deleted), which would disappear in HTML 2.0, reappear with HTML 3.2, continue into HTML 4.01 (and HTML 4.0) but only as a depreciated tag, and finally disappear in XHTML 1.1. HTML 4.01 (and HTML 4.0) would also introduce a similar tag <S> which does the same thing as the depreciated <STRIKE> tag and which also disappeared by XHTML 1.1. This too can be created by a style sheet.

<P>No difference between this <STRIKE>strikethrough
text</STRIKE> and this <S>strikethrough text</S> and this
<SPAN CLASS="stk">strikethrough text</SPAN>.</P>

No difference between this strikethrough text and this strikethrough text and this strikethrough text.

For reference, I show here the style sheet commands used in this file:

<STYLE TYPE="text/css">
SPAN.key { font-family: arial, helvetica, sans-serif;
           font-size: smaller;
           color: #FFFFFF;
           background-color: #000000;
           letter-spacing: -1px;
           text-transform: capitalize;
           padding: 1px 4px;
           border-width: thin;
           border-color: #888888;
           border-style: solid; }
SPAN.und { text-decoration: underline; }
SPAN.stk { text-decoration: line-through; }
</STYLE>

In addition, the opening <BODY> declaration tag has a style sheet declaration:

<BODY STYLE="background-color: #FFFFFF; color: #000000">

Next Level Up