Hi guys,
I was wondering if you could help me figure out the best way to write my navigation in html5.
In HTML4, it looked something like this:
Code HTML4Strict:<div id="navigation"> <ul> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> <li><a href="#">Link 5</a></li> </ul> </div>
I know in html5 they came out with the <nav> tag, So I could write it in HTML5 like this, right?
Code HTML4Strict:<nav> <ul> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> <li><a href="#">Link 5</a></li> </ul> </nav>
However, I have seen some places that show documentation on using the nav tag properly that completely omit the <ul> tags so they do
Code HTML4Strict:<nav> <li><a href="#">item 1</a></li> <li><a href="#">item 1</a></li> </nav>
And other source that omitted the <li> tags as well.
Code HTML4Strict:<nav> <a href="#">item 1</a> <a href="#"> item 2</a> </nav>
And finally, someone suggested using the <section> tag instead of <ul> because the list is a section of the navigation.So it would be:
Code HTML4Strict:<nav> <section> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> <li><a href="#">Link 5</a></li> </section> </nav>
So what I was hoping someone could help me understand is that in proper HTML5 syntax,
1.) does one omit the <ul>, <li>, or both inside a <nav>?
2.) Can <section> be a child of <nav> because I thought < section > was more of a tag for the content than the navigation?
Thanks in Advance and Best Regards,
Team 1504











Bookmarks