WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Empty tags (divs, p and strong) in the code?

for

From: Bryan Garaventa
Date: Aug 17, 2012 10:20AM


There's no need, empty static elements have no accessibility issues.

The problem with empty tags is in regard to active elements like links,
where feedback is necessary to convey the meaning of the element. Decorative
tags like lines or spacer images have no value for screen reader users, so
are best ignored.

One exception to this is when you use an empty element like a div tag that
uses a background image to convey meaning, like an arrow to convey that
clicking the image will navigate somewhere else. ARIA can then be used to
make this accessible with the correct event handlers attached.


----- Original Message -----
From: "Ramya Sethuraman" < <EMAIL REMOVED> >
To: "WebAIM Discussion List" < <EMAIL REMOVED> >
Sent: Friday, August 17, 2012 9:12 AM
Subject: Re: [WebAIM] Empty tags (divs, p and strong) in the code?


> Would it make sense to use a role="presentation" on these elements?
>
> On Fri, Aug 17, 2012 at 11:56 AM, Rabab Gomaa
> < <EMAIL REMOVED> >wrote:
>
>> Hello,
>>
>> I am wondering if using empty tags can cause any accessibility failures.
>> Example:
>> - <div class="hrline">&nbsp;</div>
>> This class is used to have a decorative horizontal line.
>>
>> - <strong></strong>
>> - <p>&#160;</p>
>> This is sometimes a miss during markup.
>>
>> I searched in the archived and found an older post about empty anchors
>> http://webaim.org/discussion/mail_thread?threadQ72 but my question is
>> about divs, p and strong elements with or without spaces like &nbsp;.
>>
>> Thank you,
>> Rabab
>>
>>
>>
>>
>> >> >> >>
>>
>
>
> --
> > >