Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with semantic symbols for accessibility in HTML?

I find this an interesting question, since there hasn't been any resource discussing this matter yet: how do you deal with symbols that has semantic meaning when writing accessible markup?

Examples would be symbols like "&", "$", "*", "-", "~", etc... Maybe the screen reader is smart enough to read "&" as "and", "$" as "dollar" and so on but some symbols don't always have definitive meaning in every scenario. For example, when you see "Jan 2 - 3, 2013" or "Jan 2 ~ 3, 2013" you know the "-" and "~" means "from ... to ...". But how do I encode that meaning into the markup? Should I use the <abbr> tag like Jan 2 <abbr title="to">~</abbr> 3, 2013?

like image 905
Xavier_Ex Avatar asked Nov 29 '13 16:11

Xavier_Ex


People also ask

How does semantic HTML help make websites accessible?

When we write semantically correct HTML, we're letting the browser know what type of content it's dealing with and how that content relates to other content. By doing this, assistive technology is more easily able to do its job because it has a structure that it can work with.

Why does semantic HTML matter to accessibility?

Using semantic HTML elements doesn't just benefit other developers by helping them understand the content better, it also allows people using assistive technologies, like screen readers, to better understand and navigate the content.


2 Answers

Screen readers have their own ways of reading characters, but they should not be expected to be particularly smart at that. For most special characters, they speak just some name for the character, independently of context and meaning.

There’s not much you can do about it. You could use span markup with title attribute containing an explanation, but it will mostly be ignored. There is somewhat better support for abbr, though it is questionable to use it for special characters. More importantly, as a W3C WAI document says, “JAWS 6.2 and higher and WindowEyes 5.0 and higher support the abbr and acronym elements. They can all be set to speak the title attribute when these elements are encountered, but this is not the default setting and is often not turned on by users.”

So what you can do is to write as naturally as possible, e.g. “January 2–3, 2013” (using an en dash rather than a hyphen, as per English style guides).

like image 191
Jukka K. Korpela Avatar answered Oct 30 '22 14:10

Jukka K. Korpela


You don't need to do anything special with special characters. You're used to interpreting symbols for their various meanings, and people using assistive technology are also used to interpreting symbols for their various meanings as well.

The cases where you would need to add additional information would be when you use an image of a symbol, or a non-standard meaning.

like image 26
zzzzBov Avatar answered Oct 30 '22 13:10

zzzzBov