Underline the access key on a button?

V

VK

Given a code like this:

....
<!-- It's small letter "l", not number 1 -->
<label for="bCC" accesskey="l"> </label>
<input type="button" name="bCC" id="bCC"
value="Load" class="unboundButton" tabindex="2">
....

Is there any way to underline "L" in "Load" to mark the shortcut?

I guess I saw somewhere a rather strange syntacs like:
<input>Label</input> or such, but cannot find it again.
Does it really exists and is it supported by the test set browsers?

Any better ideas?
 
V

VK

Underline the access key on a button?

Found similar to this in the Internet:

<label for="bCI" accesskey="s"> </label>
<button type="button" name="bCI" id="bCI"
class="unboundButton" tabindex="4"><u>S</u>how</button>

Does exactly what I need, FF 1.0.5, IE 6.0 and Opera 8.0 eat it w/o
complains.
But what is that? Is it supported by all browsers?
 
R

Robert

VK said:
Found similar to this in the Internet:

<label for="bCI" accesskey="s"> </label>
<button type="button" name="bCI" id="bCI"
class="unboundButton" tabindex="4"><u>S</u>how</button>

U/underline is deprecated since HTML 4.
Use CSS with text-decoration: underline
 
M

Michael Winter

Underline the access key on a button?
[snip]

<label for="bCI" accesskey="s"> </label>

You can, and probably should, place the accesskey attribute on the
BUTTON element, rather than an empty LABEL.
<button type="button" name="bCI" id="bCI"
class="unboundButton" tabindex="4"><u>S</u>how</button>
[snip]

But what is that?

What do you mean, what is it?
Is it supported by all browsers?

Obsolete browsers like NN4 won't support it at all, and IE's
implementation of the BUTTON element is thoroughly broken (when
submitting, anyway).

Mike
 
V

VK

Robert said:
U/underline is deprecated since HTML 4.
Use CSS with text-decoration: underline

Well, this kind of tags have "stay forever" status, no matter what W3
thinks of it (like "name" in forms and form controls).

<u>L</u>oad is much nicer and cleaner than
<span class="Underliner">L</span>oad.

But I'll give it a thought... later ;-)
 
V

VK

You can, and probably should, place the accesskey attribute on the
BUTTON element, rather than an empty LABEL.

Yep, I think so too.
Just got an impression that accesskeys acting unstable w/o designated
labels, but it was related to another curve in IE.
What do you mean, what is it?

<button>Label</button>, what else.

I used to think that it was one of proprietary IE's pervertions, and
news <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.5>

(I hate to go to W3 - gives me a heartbeat, but seems that it's all
standard and it's exactly what I was looking for).
IE's implementation of the BUTTON element is thoroughly broken
(when submitting, anyway).

That's fine by me, as it's only for interface (no submission). But
still good to know. Thanks for the info!
 
M

Michael Winter

On 18/07/2005 15:45, VK wrote:

[snip]
Well, [deprecated elements] have "stay forever" status, no matter
what W3 thinks of it (like "name" in forms and form controls).

Deprecated markup could become obsolete in the future (other elements
and attributes have in the past), in which case user agents that intend
to conform to those specifications should (?) treat any occurrences as
they would any other unrecognised element or attribute.

Note: The name attribute has not been deprecated for any form controls
by any organisation, including the W3C. Similarly the name attribute is
not deprecated on FORM elements (and others), but it is regarded as a
compatibility feature and best avoided unless you desire that
compatibility. That said, it is obsolete in some versions of XHTML.
<u>L</u>oad is much nicer and cleaner than
<span class="Underliner">L</span>oad.

You shouldn't write the latter.

<span class="mnemonic">L</span>oad

would be better. You might get away with

<em class="mnemonic">L</em>oad

(from a semantic perspective) as you are trying to emphasis the control
mnemonic, but that's pushing things a little.

[snip]

Mike
 
R

Robert

Michael said:
You shouldn't write the latter.

<span class="mnemonic">L</span>oad

It would have been nice if this works in all browsers

<button>Load</button>

button:first-letter {
text-decoration: underline;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top