-1

i just want to know is this ok if i use

this stucture:

<header>
  <h1>Luke</h1>
  <ul>
    <li><a href="#">Sign In</a></li>
    <li><a href="#">Sign Up</a></li>
  </ul>
</header>

instead of this ?

<div id="header">
  <div id="luke">
     <h1>Luke</h1>
  </div>
  <div id="navbar">
     <ul>
         <li><a href="#">Sign In</a></li>
         <li><a href="#">Sign Up</a></li>
     </ul>
  </div>
</div>

and if not, i want to know why ? and also i want to know which one is SEO Friendly and why?

  • Generally speaking, you never want to nest tags in a header tag like this. Google can handle the HTML DOM model just fine, however, it is a bad practice to pollute a header tag with complication. You do not need to do this! A h1 tag should be an extension of the title tag only more descriptive. You can easily style any list with CSS. So if you are trying to style a list with an h1 tag, don't do it. – closetnoc Jan 31 '17 at 16:58
0

At the moment, neither has an advantage over the other because search engines and browsers do not use the document outline provided by HTML5 for its stated purpose. Google will see your <h1> heading and your list while ignoring everything else.

However, that should change in the future as online publishing becomes more sophisticated and such things as headers need to be identified.

Not the answer you're looking for? Browse other questions tagged or ask your own question.