Service
  • Order of HTML5 NAV and HEADER

    In one section of my site, my NAV is above my heading.

     <nav> <ul> <li><a href="#">Service</a></li> <li><a href="#">Blog</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> <li><a href="#">Subscribe via RSS</a></li> </ul> </nav> <header> <h1>Page title</h1> </header> 

    Is it acceptable or acceptable to use NAV before the header? Or is there a rule that NAV should be after HEADER ?

    Will this affect SEO or page rank in any way?

    +6
    source share
    3 answers

    I don’t understand why not. The navigator is global navigation and therefore is not specific to this particular page. I think it makes sense that nav will be "outside" the rest of the page content. If the navigation system was designed to navigate this particular page, it should be lower.

    If, however, you had the website name in <header> and <h1> and not the page name, then I assume that it should appear under the heading.

    Edit

    As for your SEO editing, you want your keywords to be as close to the top as possible, and your headline should contain the best and most relevant keywords, so it should ideally go at the top. However, if your navigator is as long as the code you provided, I think the switching effect will be negligible. If your navigator actually consists of many nested lists for dynamic dropdowns, I would certainly think of switching them.

    +8
    source

    You can have them in any order. It is also valid to have multiple occurrences of these elements:

     <body> <header> Site header </header> <nav> Site nav </nav> <article> <header> Article header </header> <p>Article content</p> </article> </body> 
    +2
    source

    This is good, albeit a little strange - why not put them in HTML code and then use CSS to move. This, of course, is the whole point of CSS / HTML separation.

    +1
    source

    Source: https://habr.com/ru/post/898592/


    All Articles