What is the difference is usage between nav and menu in html5?
nav or menu, which one?
Menu bars allow nested menus (aka sub-menus) meaning you can put more menu items if it doesn't fit in your menu bar. However, navigation bars can't do those, and they're used for things that aren't related to one another. There are also clear differences in placements as well.
The <header> tag is generally used for heading purposes, you may see the use of these header tags <h1> to <h6>. The <nav> tag is used inside the <header> tag . This may happen if <nav> is very small and if the content of <nav> tag is used to identify the different web content.
There is no difference between and . DIV is original HTML tag while NAV was introduced as part of new HTML5 semantic tags. They behave exactly the same.
The <nav> HTML element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. Common examples of navigation sections are menus, tables of contents, and indexes.
Straight from the horse's mouth:
http://dev.w3.org/html5/spec-author-view/interactive-elements.html#menus
The menu element represents a list of commands.
E.g.:
<menu label="File"> <button type="button" onclick="fnew()">New...</button> <button type="button" onclick="fopen()">Open...</button> <button type="button" onclick="fsave()">Save</button> <button type="button" onclick="fsaveas()">Save as...</button> </menu>
http://dev.w3.org/html5/spec-author-view/sections.html#the-nav-element
The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links.
<nav>
is a general section of the site layout that holds navigation content
<menu>
is a list of commands within the navigation or any other layout section
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With