< NAV>或< menu> (HTML5) [英] <nav> or <menu> (HTML5)

查看:122
本文介绍了< NAV>或< menu> (HTML5)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

W3Schools.com和我很确定我记得看到W3C.org的状态,应该为工具栏菜单和列表表单控制命令使用< menu> 。 / p>

那么,我应该在我的主菜单中使用哪一个? Nav 菜单?这是否重要?

解决方案

nav 用于组内部链接( a 元素)。通常这意味着链接应该到达单独的页面,或者在AJAX页面的情况下更改内容。点击 nav 项目时,预计会发生某些内容更改。



菜单用于控件组( a 输入按钮)。通常这意味着输入应该在页面内执行一个功能。当点击一个菜单项目时,预计会出现某种类型的javascript交互。 $ b

nav code $:导航



菜单菜单


W3Schools.com and I'm pretty sure I remember seeing W3C.org state that <menu> should be used for Toolbar menus and listing form control commands.

So, which one should I use for my main menu? Nav, or Menu? Does it matter?

解决方案

nav is used for groups of internal links (a elements). Generally this means the links should travel to separate pages, or change content in the case of an AJAX page. Expect some sort of content change when clicking on a nav item.

menu is used for groups of controls (a, input, button). Generally this means the inputs should perform a function within the page. Expect some sort of javascript interaction when clicking on a menu item.

nav: the navigation for the site.

menu: the menu for a web application.

这篇关于&LT; NAV&GT;或&lt; menu&gt; (HTML5)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆