<main> or <main role="main">

Post here if your topic is about CSS HTML Validator but doesn't fit in another forum.
Post Reply
Walter Metzger
Rank II - Novice
Rank II - Novice
Posts: 48
Joined: Tue Feb 26, 2008 12:57 pm
Location: Germany

<main> or <main role="main">

Post by Walter Metzger »

Visitors of the forum,

I use for http://www.vfk-es.de/
<main role="main">
validate with F6 I receive no message

when I use
I receive with F 6
The "main" element should contain the role="main" attribute for user agents that don't (yet) implement the required role mapping. This improves accessibility.

When I investigate my homepage whith
https://validator.w3.org/ - using <main role="main">
I receive
Warning: Element main does not need a role attribute

Do I have use <main> or <main role="main"> ?

from Germany in Spring-time
Walter Metzger
User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3578
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: <main> or <main role="main">

Post by Albert Wiersch »

Hi Walter,

In most cases (with modern browsers) role="main" is unnecessary and even undesirable. However, for old user agents it might still be helpful. At this point in time I think the "main" element has been around long enough (and most people are using browsers that make it unnecessary) that I'm going to remove the message about using role="main" in the next update.

Thanks for bringing this to my attention.
Post Reply