E-mail List Archives

Re: screen readers and empty paragraphs

for

From: Jukka K. Korpela
Date: Nov 12, 2008 2:50PM


Angela French wrote:

> Can anyone tell me if there are any ramifications (for screen readers)
> for empty paragraphs tags?

You mean empty paragraph _elements_.

According to HTML specifications,
1) Authors should not use empty paragraphs.
2) User agents should ignore them.
But we need to add:
3) User agents don't always ignore them. Visual user agents may leave extra
empty space. I would not be surprised if some aural user agents treated them
as causing some extra pause.

The conclusion is that you should not use empty paragraphs. But if existing
pages contain them, you should probably spend your time more constructively
than removing empty paragraphs. Beware that they may have been inserted on
purpose, for spacing, and they may have that effect, so layout might get
changed. It is of course possible to create spacing using CSS, but cleaning
up existing pages is usually waste of time, and risky.

Actually it is probably much more common to have a paragraph that contains a
no-break space only, <p>&nbsp;</p>. It tends to cause spacing worth of one
empty line. It is technically not empty, so in principle HTML specs don't
say anything specific about them, but the spirit there is clearly that
spacing should be achieved using style sheets, not trickery with dummy HTML
elements.

> For example: <p></p>

Or for example the paragraph element in

<p>
<h2>Hello world</h2>

The old, 1990-style habit of using <p> as a paragraph _terminator_ often
creates unintended empty paragraphs.

--
Yucca, http://www.cs.tut.fi/~jkorpela/