WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: nobr


From: Jukka K. Korpela
Date: Dec 6, 2005 9:00AM

On Tue, 6 Dec 2005, Penny Roberts wrote:

> Leaving aside the fact that <nobr> is not valid

It is not valid when DTDs defined by the W3C are used. It is valid if you
use a suitable DTD; see

> I would imagine that
> it could have some accessibility/usability problems:

It could. So could lack of it. When a string is broken into two lines in
an appropriate way, it can be difficult to many and impossible to some to
recognize the intended meaning. For example, if the string "-42", where
the hyphen is meant to act as a minus sign, is broken into "-" and "42",
difficulties arise.

> for instance if it were
> used on a very long section of text it would require horizontal scrolling.

That is correct. Here the basic question is prevention of line breaks, not
the technique used for it. The <nobr> markup is the technique that works
often and has no side effects, but there are many other techniques,
such as the nowrap attribute in a table cell, the no-break space, and
the word joiner (WJ) character

> Would there be any accessibility issues with it being used on a few words or
> as part of a form to keep form elements together? (No, I'm not using it,
> someone else might be.)

It's always possible that anything that creates a lower limit for the
canvas width causes problems to some users. The risk is negligible,
however, if you use <nobr> or other line break prevention technique to
"glue" two short words together. Besides, such "glueing" may improve
readability. Form fields are a different issue, and the prime rule for
forms fields should be: one field on one line, with label before the field
(or after it, for radio buttons and checkboxes). This is useful for
clarity and helps people with cognitive disabilities. Therefore, the idea
of forcing two fields to stay on one line is very questionable. On the
other hand, it might be a good idea to try to ensure that the label and
field are on the same line. They should normally be so short that this
should not be a problem.

Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/