WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: can <p> be used in place of <legend>?

for

Number of posts in this thread: 11 (In chronological order)

From: Shrirang Sahasrabudhe
Date: Thu, Jul 20 2006 2:50AM
Subject: can <p> be used in place of <legend>?
No previous message | Next message →

hi,
i wrote following mark up in order
toevaluating use of p instead of legend for accessibility..
<snip>
<html>
<body>
<h2> use of legend </h2>
<fieldset>
<legend> are you a member? </legend>
<input type=radio name=connectiontype id=r_legend_yes> Yes
<input type=radio name=connectiontype id=r_legend_no> No
</fieldset>
<h2> use of p </h2>
<fieldset>
<p> are you a member? </p>
<input type=radio name=connectiontype id=r_p_yes> <label for="r_p_yes">Yes</label>
<input type=radio name=connectiontype id=r_p_no> <label for="r_p_no">No</label>
</fieldset>
</body>
</html>
</snip>
i am using jaws5 and IE 6..
jaws gives same results in both the cases..
can <legend> be replaced safely with <p> ?
thanks.
Shri



***********************************************************
If you try, you risk failure. If you don't, you ensure it....I try.
Shrirang Sahasrabudhe,
Pune, India.
Phone: 0091-020-4227558.

---------------------------------
See the all-new, redesigned Yahoo.com. Check it out.




From: Christian Heilmann
Date: Thu, Jul 20 2006 3:00AM
Subject: Re: can <p> be used in place of <legend>?
← Previous message | Next message →

> i am using jaws5 and IE 6..
> jaws gives same results in both the cases..
> can <legend> be replaced safely with <p> ?
> thanks.

That logic does not quite hold up. It's an exercise not a good idea.
The next versions of Jaws or older versions or other software might
not support it and from a strictly semantic point of view it is not
making any sense.

It is like relying on bad browser implementation of CSS for layout
rather than following the standard.

The main question is: Why would you want to replace LEGEND with a P?




From: Shrirang Sahasrabudhe
Date: Thu, Jul 20 2006 3:10AM
Subject: Re: can <p> be used in place of <legend>?
← Previous message | Next message →

i came across a page developed by one of my colleague;
the page was quite accessible so i checked the code...
he had used <p> instead of <legend...
so i wanted to clarify whether this is right or not?
thanks for your quick response..
Shri


Christian Heilmann < = EMAIL ADDRESS REMOVED = > wrote: > i am using jaws5 and IE 6..
> jaws gives same results in both the cases..
> can be replaced safely with ?
> thanks.

That logic does not quite hold up. It's an exercise not a good idea.
The next versions of Jaws or older versions or other software might
not support it and from a strictly semantic point of view it is not
making any sense.

It is like relying on bad browser implementation of CSS for layout
rather than following the standard.

The main question is: Why would you want to replace LEGEND with a P?







***********************************************************
If you try, you risk failure. If you don't, you ensure it....I try.
Shrirang Sahasrabudhe,
Pune, India.
Phone: 0091-020-4227558.

---------------------------------
See the all-new, redesigned Yahoo.com. Check it out.




From: Alastair Campbell
Date: Thu, Jul 20 2006 3:20AM
Subject: RE: can <p> be used in place of <legend>?
← Previous message | Next message →

> The main question is: Why would you want to replace LEGEND with a P?

Because browser CSS support for styling the legend sucks :(

http://www.quirksmode.org/bugreports/archives/2006/03/Positioning_the_le
gend_tag.html

http://marc.baffl.co.uk/bugs.php#legend

> The next versions of Jaws or older versions or other software might
> not support it and from a strictly semantic point of view it is not
> making any sense.

Where a design has needed some kind of positioning, background, or
anything more than a basic legend, I've taken to using a heading
instead.

Not ideal, but probably better than a <p>.

Kind regards,

-Alastair

--
Alastair Campbell | Director of User Experience

Nomensa Email Disclaimer:
http://www.nomensa.com/email-disclaimer.html




From: Alastair Campbell
Date: Thu, Jul 20 2006 3:30AM
Subject: RE: can <p> be used in place of <legend>?
← Previous message | Next message →

Oops, I had meant to say that I agreed with this bit:

> Where a design has needed some kind of positioning, background, or
> anything more than a basic legend, I've taken to using a heading
> instead.

That came over more blunt than I'd intended!

I'm also just guessing that CSS support for legend was the issue, it may
not be.

Sorry,

-Alastair




From: Patrick Lauke
Date: Thu, Jul 20 2006 3:50AM
Subject: RE: can <p> be used in place of <legend>?
← Previous message | Next message →

> Alastair Campbell

> Where a design has needed some kind of positioning, background, or
> anything more than a basic legend, I've taken to using a heading
> instead.

I'm just wondering, though, what happens when a user is in forms mode (or equivalent)? Would they have to exit forms mode to even be aware of the headings, whereas legends would be announced? Sorry, been a while since I had a play with JAWS...

Patrick
________________________________
Patrick H. Lauke
Web Editor / University of Salford
http://www.salford.ac.uk
________________________________
Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
________________________________




From: Christian Heilmann
Date: Thu, Jul 20 2006 4:00AM
Subject: Re: can <p> be used in place of <legend>?
← Previous message | Next message →

On 7/20/06, Patrick Lauke < = EMAIL ADDRESS REMOVED = > wrote:
> > Alastair Campbell
>
> > Where a design has needed some kind of positioning, background, or
> > anything more than a basic legend, I've taken to using a heading
> > instead.
>
> I'm just wondering, though, what happens when a user is in forms mode (or equivalent)? Would they have to exit forms mode to even be aware of the headings, whereas legends would be announced? Sorry, been a while since I had a play with JAWS...

I really think it shouldn't matter. Fieldset and Legend go together,
If you break this logic because of some design issues then your design
is not right for the task. MSIE renders form elements without a FORM
tag surrounding them, is that valid to use then, too?




From: Patrick Lauke
Date: Thu, Jul 20 2006 4:10AM
Subject: RE: can <p> be used in place of <legend>?
← Previous message | Next message →

> Christian Heilmann

> I really think it shouldn't matter.

Of course it shouldn't, just exploring even further reasons why legends are better than other markup constructs.

P
________________________________
Patrick H. Lauke
Web Editor / University of Salford
http://www.salford.ac.uk
________________________________
Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
________________________________




From: ben morrison
Date: Thu, Jul 20 2006 4:20AM
Subject: Re: can <p> be used in place of <legend>?
← Previous message | Next message →

On 7/20/06, Patrick Lauke < = EMAIL ADDRESS REMOVED = > wrote:
> > Alastair Campbell
>
> > Where a design has needed some kind of positioning, background, or
> > anything more than a basic legend, I've taken to using a heading
> > instead.
>
> I'm just wondering, though, what happens when a user is in forms mode (or equivalent)? Would they have to exit forms mode to even be aware of the headings, whereas legends would be announced? Sorry, been a while since I had a play with JAWS...

I've always been under the impression that headings are read out but
<p> is not in forms mode. If you use fieldset then surely it needs a
legend though, if text is too long i use a simplified legend text with
an additional heading, to avoid css issues with legend tags.

ben




From: Alastair Campbell
Date: Thu, Jul 20 2006 4:30AM
Subject: RE: can <p> be used in place of <legend>?
← Previous message | Next message →

Hia,

You would expect that legends would be announced in forms mode (and
indeed JAWs does - just checked). Headings are not (at least in version
6).

Hmm, may have to add some hidden legends or something.

> I really think it shouldn't matter. Fieldset and Legend go together,
> If you break this logic because of some design issues then your
> design is not right for the task.

I'd disagree, the rendering of legends is so broken that applying a
design is next to impossible. If you can figure it out on a page like
this: http://www.nomensa.com/web_design.html (and select the "Want to
know more" link), I will take my virtual hat off to you :)

> MSIE renders form elements without a FORM
> tag surrounding them, is that valid to use then, too?

That's a reversal, we talking about not being able to get the valid way
working, not using an invalid one because it works (sometimes).

Kind regards,

-Alastair

--
Alastair Campbell | Director of User Experience

Nomensa Email Disclaimer:
http://www.nomensa.com/email-disclaimer.html




From: Tim Harshbarger
Date: Thu, Jul 20 2006 6:00AM
Subject: RE: can <p> be used in place of <legend>?
← Previous message | No next message

In regards to JAWS, it is better to use the legend element rather than
the paragraph or any of the heading elements.

If you use a legend within a fieldset element, JAWS will always read the
contents of the legend element when the user tabs to any of the controls
within the fieldset.

If you use either the paragraph or heading elements, JAWS might read
that information or it might not.

My guess is that when the paragraph or heading elements are used, JAWS
has to rely on an algorithm to determine if there is a legend and what
the legend might be. When the legend element is used, JAWS can rely on
the mark-up.

I expect that is why you will sometimes receive reliable results using a
paragraph or heading elements.

If you choose to encode the legend content with a paragraph or heading
element, there is something you need to be aware of. While testing in
your environment might indicate that a screen reader will always read
the legend information correctly, that will only be the case for the
users if their display mimics yours exactly. If their display is
different, what is read will depend on how the browser presents the
information.

Unfortunately, I am not as familiar with the other screen readers, so I
cannot speak to how they deal with these elements.

Tim