• Hey all.

    In the header of the default wordpress template there is this bit of code

    <div id="header" role="banner">

    What is the relevance of role=”banner”? What does it do?

Viewing 6 replies - 1 through 6 (of 6 total)
  • From best I can gather, the Role Attribute is used to provide a more semantic markup, and further increase the accessibility of your content, page, code, application, etc.

    The attribute describes the role(s) the current element plays in the context of the document. This can be used, for example, by applications and assistive technologies to determine the purpose of an element. This could allow a user to make informed decisions on which actions may be taken on an element and activate the selected action in a device independent way. It could also be used as a mechanism for annotating portions of a document in a domain specific way (e.g., a legal term taxonomy).

    Example:

    <ul role="navigation sitemap">
        <li href="downloads">Downloads</li>
        <li href="docs">Documentation</li>
        <li href="news">News</li>
    </ul>

    http://www.w3.org/TR/2008/WD-xhtml-role-20080407/

    http://www.w3.org/TR/wai-aria/#def_Role

    Role
    An indicator of type. The object’s role is the class of objects of which it is a member. This semantic association allows tools to present and support interaction with the object in a manner that is consistent with user expectations about other objects of that type.

    4.3.6. Landmark Roles
    banner (role) – A region that contains the primary heading or web site title.

    Too bad it currently breaks validation. Since I updated to 2.8.0 the validator complains about the banner attribute not being XHTML 1.0 Transitional compliant 🙁

    Thread Starter jordanton

    (@jordanthegreat)

    Sooo. What I gather is that wordpress put it in there but didn’t actually make use of it? Like if I took it out, nothing would happen?

    I’ve had to take those tags out for now – but I’ve just commented them out using <?php # role=”main”; ?> etc so that it’ll be easy for me to put them back later on should these tags become compliant.

    Sorry – meant to say, no, nothing will happen if you take them out.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘what is role=”banner”?’ is closed to new replies.