WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Hiding Legends

for

From: Korpela Jukka
Date: Oct 16, 2008 1:40AM


Dean Hamack wrote:

>> Why do you want to hide it, and how is this an accessibility issue?
>> (Hiding
>> the legend does not sound to _improve_ accessibility.)
>
> Because legends generally aren't necessary for sighted people.

That's an odd idea. If grouping fields in fieldsets with headings, or
"legends", is useful in the first place, why would those headings
magically become useless if you can see them?

> They are
> necessary for blind people when there are multiple fields with similar
> labels.

Another odd idea. Fieldsets, with legends, should be used for useful
grouping that helps everyone to understand the structure and meaning. They
should not be used as tricks.

> Read this article:
>
> http://www.sitepoint.com/article/fancy-form-design-css/

Looks like styling of forms in CSS. Nothing specifically
accessibility-related, and I didn't find anything about hiding legends. I
admit I did not read that carefully, since I think I know CSS pretty well
(and I would first consult my own book on CSS if I needed to recollect
things...).

>> I don't think there's nothing usual there.
>
> Guess you're new around here. That's the way we hide elements for
> accessibility:
>
> http://webaim.org/techniques/css/invisiblecontent/

That's nothing usual. It might be popular among some fraction of misguided
accessibility enthusiasts. Writing separate code with different tricks for
different assumed modes of browsing tends to lead to confusion, just like
writing separate code for different browsers does. We might sometimes be
forced to such things, but it should be the last resort and nothing to be
proud of - and surely nothing to be advocated as "usual".

>> But if you really want to hide legend elements, why don't you use just
>> legend { display: none; }
>
> Because that's not accessible.

Of course it's "not accessible", but that's because the very idea of
hiding legends isn't.

You probably mean that it hides legends too well, i.e. performs what you
asked for instead of what you meant.

But if you ask how to hide an element, don't look so surprised if someone
suggests a very simple, effective method for doing it.

Yucca