html <menu> 标签
- <mark>
- <menuitem>
实例
带有两个菜单按钮 ("file" 和 "edit") 的工具栏,每个按钮都包含带有一系列选项的下拉列表:
<menu type="toolbar"> <li> <menu label="file"> <button type="button" onclick="file_new()">new...</button> <button type="button" onclick="file_open()">open...</button> <button type="button" onclick="file_save()">save</button> </menu> </li> <li> <menu label="edit"> <button type="button" onclick="edit_cut()">cut</button> <button type="button" onclick="edit_copy()">copy</button> <button type="button" onclick="edit_paste()">paste</button> </menu> </li> </menu>
亲自试一试
浏览器支持
ie firefox chrome safari opera目前所有主流浏览器都不支持 <menu> 标签。
定义和用法
<menu> 标签定义命令的列表或菜单。
<menu> 标签用于上下文菜单、工具栏以及用于列出表单控件和命令。
提示和注释:
提示:请使用 css 来设置菜单列表的样式!
html 4.01 与 html5 之间的差异
在 html 4.01 中已弃用 <menu> 元素。
在 html5 中重新定义了 <menu> 元素。
html 与 xhtml 之间的差异
在 html 4.01 中,menu 元素不被赞成使用。
在 xhtml 1.0 strict dtd 中,menu 元素不被支持。
属性
new: html5 中的新属性。
属性 值 描述| label | text | 规定菜单的可见标签。 |
| type |
|
规定要显示哪种菜单类型。 |
全局属性
<menu> 标签支持 html 中的全局属性。
事件属性
<menu> 标签支持 html 中的事件属性。
相关页面
html dom 参考手册:column 对象
- <mark>
- <menuitem>
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!