Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8831211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:15:37+00:00 2026-06-14T08:15:37+00:00

The following markup got an error from the validator: <!DOCTYPE html> <html lang=en> <head>

  • 0

The following markup got an error from the validator:

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Bla Bla Bla</title>
</head>
<body>

    <h1 role="banner">Bla Bla Bla</h1>

    <section role="main">
        <h1>Bla Bla Bla</h1>
        <p>Bla Bla Bla</p>
    </section>

    <p role="contentinfo"><small>Bla Bla Bla</small></p>

</body>
</html>

The error is: Error: Attribute role not allowed on element h1 at this point.

Does that mean role="banner" must be on header element?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:15:38+00:00Added an answer on June 14, 2026 at 8:15 am

    An ARIA role can be assigned to any HTML element. From the WAI-ARIA docs:

    3.2.7.1 ARIA Role Attribute

    Every HTML element may have an ARIA role attribute specified.


    However, there are various restrictions on what certain elements can be given as a role, mostly to prevent the implicit semantics from getting you into a muddled state with your explicit semantics.

    If you look at tables in the W3C HTML5 specification linked to above, you’ll see under "Implicit ARIA semantics" that a h1 without a hgroup ancestor must have a role of either heading or tab, if set.

    That’s why you’re getting the validation error.

    You’ll also see from those tables that head has a strong native semantic of no role, meaning you can’t set that either – it must be set to presentation. I’m not sure if that’s what you meant since you have no header element in your sample.

    If you did have a header element then yes, you can set its role to banner – in fact that’s all you’re allowed to set it to (if you set it at all). That’s also covered by those tables I’ve linked to above.

    You could also try putting the h1 inside a section with a banner role – that would have been my first attempt at fixing this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a markup with the following structure : <body> <h1>Title</h1> <p>bla</p> <div> ...
I've got the following field on an MVC view: @Html.TextBoxFor(model => model.Course.Title, new {
I've got the following Flex application markup: <app:MyApplicationClass xmlns:app=* width=100% height=100% layout=vertical horizontalScrollPolicy=off verticalScrollPolicy=off>
I got following markup twice on the page with different id for each .option
I've got the following markup: <div id=accordion class=leftaligned> <div> <h3><a href=#>Stakeholder</a></h3> <div>Content</div> </div> <div>
I have the following markup. @(Html.Telerik().Grid(Model) .Name(Grid) .DataKeys(keys => keys.Add(key => key.Id)) .Columns(columns =>
I've got the following markup in a WPF UserControl: <Border Name=_border BorderThickness=4 BorderBrush=Blue> <Canvas
According to my understanding the following HTML markup should display a heart symbol, but
The following markup is exaggerated to demonstrate the problem. I'm trying to capture the
To generate the following markup: <label class=foo>Bar</label> The PHP will look something like: <?php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.