WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: use of <pre> tag

for

From: Jared Smith
Date: Nov 4, 2010 5:42PM


On Thu, Nov 4, 2010 at 4:28 PM, Simius Puer wrote:

> whilst the
> document is not "inaccessible" as such, it contains absolutely no semantic
> mark-up and can not be considered accessible.

Your e-mail contained no absolutely semantic mark-up, so it cannot be
considered accessible, right?

I am, of course, being a bit cynical. The lack of markup doesn't
render something automatically inaccessible. Either the lack of markup
where markup is necessary or the inappropriate use of markup might
make something less accessible.

Perhaps Julie can explain what she means by "non-tabular data". I
can't envision how non-tabular data would be any more accessible if
presented using <pre>.

The <pre> element usually presents text in a mono-spaced font, which
could be useful so long as other relationships or semantics are not
being presented purely through the visual presentation. For example,
if you use <pre> to layout a grid of data instead of using a <table>,
this would be problematic. Of course, if a table is needed, that would
make it tabular data, not non-tabular data.

If Julie is asking whether surrounding long sections of text data in a
web page with <pre> will make it any more accessible, the answer is
"probably not". Long content in a pre-formatted, mono-spaced font will
likely be more difficult to read. As far as screen readers are
concerned, they do nothing special with the <pre> element. If other
relationships or semantics are being presented through purely visual
text changes, then appropriate markup is probably necessary.

Jared Smith
WebAIM