Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Basics Structuring Your Content Semantic HTML: <header>, <footer> and <section>

Natalia Garrido
Natalia Garrido
474 Points

Footer Accessibility Question

I was reading the MDN footer article that's linked in the teacher notes and it noted that the VoiceOver screen reader has issues with not announcing the footer landmark role. The article recommends adding role="contentinfo" to the footer element.

My question is what it would look like. I want to use it properly but couldn't find an example on how it would look in functioning code.

They had a link to WebKit Bugzilla about it that went straight over my head.

Would the code I put below work?

<footer role="contentinfo"> <p>Here is my footer.</p> </footer>

Also, is "contentinfo" asking for a description like I would for an alt tag or is it what gets the reader to recognize the footer?

I know this is only a related question- would there be a better place to ask?

2 Answers

Lachlan Stevens
Lachlan Stevens
10,779 Points

The example you've provided is the correct way to add the role to a footer tag.

contentinfo is the actual content that is in the attribute, rather than being a placeholder for something else. The screenreader is actually looking for contentinfo to be present in the tag.

Note that this is is only really required for safari - Firefox and Chrome both automatically apply the contentinfo role to footer tags except for a couple of special cases (for example if the footer tag is a child of an <article> tag).

Natalia Garrido
Natalia Garrido
474 Points

Thank you for answering my questions.

Fran ADP
Fran ADP
6,304 Points

contentinfo is the content in the attribute.