简体   繁体   中英

What is the difference is usage between <nav> and <menu> in html5?

What is the difference is usage between nav and menu in html5?

nav or menu, which one?

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.

Eg:

 <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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM