WebAIM - Web Accessibility In Mind

E-mail List Archives

Using ARIA for styling?

for

From: Preast, Vanessa
Date: Mar 6, 2017 8:05AM


I'm a novice when it comes to ARIA.

I'd like the menu item for the currently active page to have a different appearance within the menu. To kill two birds with one stone, I was thinking it would be nice to refer to the ARIA to change the appearance of menu items. Can I style based on whether the ARIA-selected is true or false? If so, what would that css code look like?

Here is some HTML code for a menu I'm working with right now for a menu:
<ul>
<li><a href="index.html" aria-selected="false">Home</a></li>
<li><a href="example1.html" aria-selected="false">Another Menu Item</a></li>
<li><a href="example2.html" aria-selected="true">Current page</a></li>
</ul>

Thanks,
Vanessa