开发者

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

开发者 https://www.devze.com 2023-02-21 21:17 出处:网络
开发者_JAVA技巧What is the difference is usage between nav and menu in html5? nav or menu, which one?Straight from the horse\'s mouth:
开发者_JAVA技巧

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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号