Page 139 - HTML5
P. 139

•  The <header> and <footer> tags are siblings to the <main> element.


              Notes:
              The HTML5 specification recognizes the <main> element as a grouping element, and not
              a sectioning element.

                  •  ARIA role attributes: main (default), presentation
              Adding a role="main" ARIA role attribute to other elements intended to be used as
              main content is advised to aid user agents that don't support HTML5 and also to
              provide more context for those that do.

              The <main> element by default has the main role, and so does not need to be provided.
        Click here to read the official HTML5 Specification for the <main> element


        Nav Element

        The <nav> element is primarily intended to be used for sections that contain main navigation
        blocks for the website, this can include links to other parts of the web page (e.g. anchors for
        a table of contents) or other pages entirely.


        Inline items

        The following will display an inline set of hyperlinks.

         <nav>
             <a href="https://google.com">Google</a>
             <a href="https://www.yahoo.com">Yahoo!</a>
             <a href="https://www.bing.com">Bing</a>
         </nav>


        Use list items when needed


        If the content represents a list of items, use a list item to show this and enhance the user
        experience.

        Note the role="navigation", more on this below.

         <nav role="navigation">
             <ul>
                 <li><a href="https://google.com">Google</a></li>
                 <li><a href="https://www.yahoo.com">Yahoo!</a></li>
                 <li><a href="https://www.bing.com">Bing</a></li>
             </ul>
         </nav>


        Avoid unnecessary usage


        <footer> elements may have a list of links to other parts of the site (FAQ, T&C, etc.). The
        footer element alone is sufficient in this case, you don't need to further wrap your links with
        a <nav> element in the <footer>.

         <!-- the <nav> is not required in the <footer> -->
         <footer>
             <nav>
                 <a href="#">...</a>
             </nav>



        https://riptutorial.com/                                                                             123
   134   135   136   137   138   139   140   141   142   143   144