Menus example in html

Содержание
  1. HTML Tag
  2. Syntax
  3. Result
  4. Example of the HTML tag for creating a context menu:
  5. Attributes
  6. How to style tag?
  7. Common properties to alter the visual weight/emphasis/size of text in tag:
  8. Coloring text in tag:
  9. Text layout styles for tag:
  10. Other properties worth looking at for tag:
  11. : The Menu element
  12. Usage notes
  13. Examples
  14. Toolbar
  15. HTML
  16. CSS
  17. Result
  18. Technical summary
  19. Specifications
  20. Browser compatibility
  21. See also
  22. Found a content problem with this page?
  23. MDN
  24. Support
  25. Our communities
  26. Developers
  27. 102 CSS Menu
  28. Table of Contents
  29. Related Articles
  30. Author
  31. Links
  32. Made with
  33. About a code
  34. Menu
  35. Author
  36. Links
  37. Made with
  38. About a code
  39. Fullscreen Overlay Navigation Bar
  40. Author
  41. Links
  42. Made with
  43. About a code
  44. Three Fancy Link Hover Effects
  45. Author
  46. Links
  47. Made with
  48. About a code
  49. Navigation Dotted Hover Effect
  50. Author
  51. Links
  52. Made with
  53. About a code
  54. Fullscreen Overlay Navigation Bar
  55. Author
  56. Links
  57. Made with
  58. About a code
  59. Context Menu
  60. Author
  61. Links
  62. Made with
  63. About a code
  64. Pure CSS Menu
  65. Author
  66. Links
  67. Made with
  68. About a code
  69. Neumorphism Context Menu
  70. Author
  71. Links
  72. Made with
  73. About a code
  74. Simple Navigation System
  75. Author
  76. Links
  77. Made with
  78. About a code
  79. CSS Menu
  80. Author
  81. Links
  82. Made with
  83. About a code
  84. Fullscreen Menu Enter
  85. Author
  86. Links
  87. Made with
  88. About a code
  89. Context Menu with Feather Icons
  90. Author
  91. Links
  92. Made with
  93. About a code
  94. CSS Hamburger Menu
  95. Author
  96. Links
  97. Made with
  98. About a code
  99. Text Fill on Hover
  100. Author
  101. Links
  102. Made with
  103. About a code
  104. List Item Hower Effect
  105. Author
  106. Links
  107. Made with
  108. About a code
  109. CSS-Only Marquee Effect
  110. Author
  111. Links
  112. Made with
  113. About a code
  114. CSS Full-Page Navigation
  115. Author
  116. Links
  117. Made with
  118. About a code
  119. Randomly Generated CSS Blobby Nav
  120. Author
  121. Links
  122. Made with
  123. About a code
  124. Full-Page Navigation
  125. Author
  126. Links
  127. Made with
  128. About a code
  129. Pure CSS Full Page Nav
  130. Author
  131. Links
  132. Made with
  133. About a code
  134. Fold Out Mobile Menu
  135. Author
  136. Links
  137. Made with
  138. About a code
  139. Menu Hover Fill Text
  140. Author
  141. Links
  142. Made with
  143. About a code
  144. Menu with Awesome Hover
  145. Author
  146. Links
  147. Made with
  148. About a code
  149. CSS Navigation Bar
  150. Author
  151. Links
  152. Made with
  153. About a code
  154. Menu Hover Underline
  155. Author
  156. Links
  157. Made with
  158. About a code
  159. Apple TV Menu Interface
  160. Author
  161. Links
  162. Made with
  163. About a code
  164. CSS Strange Nav
  165. Author
  166. Links
  167. Made with
  168. About a code
  169. Navbar with Pure CSS
  170. Author
  171. Links
  172. Made with
  173. About a code
  174. Navbar Interaction
  175. Author
  176. Links
  177. Made with
  178. About a code
  179. Off Canvas Menu Pure CSS
  180. Author
  181. Links
  182. Made with
  183. About a code
  184. Menu Bar CSS
  185. Author
  186. Links
  187. Made with
  188. About a code
  189. Vertical Dark Menu with CSS
  190. Author
  191. Links
  192. Made with
  193. About the code
  194. Moving Underline Nav Menu
  195. Author
  196. Links
  197. Author
  198. Links
  199. Made with
  200. About the code
  201. Navigation Menu
  202. Author
  203. Links
  204. Made with
  205. About the code
  206. 3D Navbar
  207. Author
  208. Links
  209. Made with
  210. About the code
  211. Just Another Menu
  212. Author
  213. Links
  214. Made with
  215. About the code
  216. Pure CSS Menu
  217. Author
  218. Links
  219. Made with
  220. About the code
  221. CSS Menu Feat. Emoji
  222. Author
  223. Links
  224. Made with
  225. About the code
  226. The Menu
  227. Author
  228. Links
  229. Made with
  230. About the code
  231. Menu Effect
  232. Author
  233. Links
  234. Made with
  235. About the code
  236. CSS-Only Nested Dropdown Navigation
  237. Full Page Off-Canvas Navigation
  238. Simple Radial Menu
  239. Accordion Menu
  240. Mobile Filter Menu
  241. Author
Читайте также:  Python can open file exception

HTML Tag

The tag defines a list of commands. It is used for creating context menus, toolbars, listing form controls, and commands.

A context menu consists of a element that has elements for each selectable option, as well as


elements that break up the content of the menu into sections with the help of separator lines.

A toolbar menu consists of a element. Here, the content of this element can be described in two ways:

  • It can contain an unordered list of items that are represented by the HTML
  • element.
  • It can contain flow content that describes the accessible options and commands.

The

was a deprecated HTML tag in HTML 4.01 and has been redefined in HTML5. It works only for context menus. Use the element instead.

Each list item in tag starts with the or the elements.

Syntax

The

tag comes in pairs. The content is written between the opening ( ) and closing (

) tags.

html> html> head> title>Title of the document title> style> menuitem < display: block; > style> head> body> menu> menuitem>ol - ordered list menuitem> menuitem>ul - unordered list menuitem> menuitem>menu - menu list menuitem> menu> body> html>

Result

menu tag example

Example of the HTML tag for creating a context menu:

html> html> head> title>Title of the document title> head> body> div style="background:#1c87c9; padding: 20px; text-align:center; color:#ffffff;" contextmenu="menuexample"> p>Right-click inside this box to open the context menu p> menu type="context" id="menuexample"> menuitem label="Refresh" onclick="window.location.reload();"> menuitem> menu label="Share on. "> menuitem label="Twitter" onclick="window.open('//twitter.com/intent/tweet?text=' + window.location.href);"> menuitem> menuitem label="Facebook" onclick="window.open('//facebook.com/sharer/sharer.php?u=' + window.location.href);"> menuitem> menu> menuitem label="Email This Page" onclick="window.location='mailto:?body='+window.location.href;"> menuitem> menu> div> p>span style="color:red;">Reminder: span> This works only in Firefox. p> body> html>

    elements are used to create an unordered lists. The main difference between them is that the tag contains display items, while the

      tag contains interactive ones.

    Attributes

    Attribute Value Description
    label text Defines a visible label for the menu.
    type popup
    toolbar
    context
    Defines the type of the menu.

    How to style tag?

    Common properties to alter the visual weight/emphasis/size of text in tag:

    • CSS font-style property sets the style of the font. normal | italic | oblique | initial | inherit.
    • CSS font-family property specifies a prioritized list of one or more font family names and/or generic family names for the selected element.
    • CSS font-size property sets the size of the font.
    • CSS font-weight property defines whether the font should be bold or thick.
    • CSS text-transform property controls text case and capitalization.
    • CSS text-decoration property specifies the decoration added to text, and is a shorthand property for text-decoration-line, text-decoration-color, text-decoration-style.

    Coloring text in tag:

    • CSS color property describes the color of the text content and text decorations.
    • CSS background-color property sets the background color of an element.

    Text layout styles for tag:

    • CSS text-indent property specifies the indentation of the first line in a text block.
    • CSS text-overflow property specifies how overflowed content that is not displayed should be signalled to the user.
    • CSS white-space property specifies how white-space inside an element is handled.
    • CSS word-break property specifies where the lines should be broken.

    Other properties worth looking at for tag:

    • CSS text-shadow property adds shadow to text.
    • CSS text-align-last property sets the alignment of the last line of the text.
    • CSS line-height property specifies the height of a line.
    • CSS letter-spacing property defines the spaces between letters/characters in a text.
    • CSS word-spacing property sets the spacing between words.

    Источник

    : The Menu element

    This element only includes the global attributes.

    Usage notes

    Note: In early versions of the HTML specification, the element had an additional use case as a context menu. This functionality is considered obsolete and is not in the specification.

    Examples

    Toolbar

    In this example, a is used to create a toolbar for an editing application.

    HTML

    menu> li>button onclick="copy()">Copybutton>li> li>button onclick="cut()">Cutbutton>li> li>button onclick="paste()">Pastebutton>li> menu> 

    Note that this is functionally no different from:

    ul> li>button onclick="copy()">Copybutton>li> li>button onclick="cut()">Cutbutton>li> li>button onclick="paste()">Pastebutton>li> ul> 

    CSS

    menu, ul  display: flex; list-style: none; padding: 0; width: 400px; > li  flex-grow: 1; > button  width: 100%; > 

    Result

    Technical summary

    Flow content. If the element’s children include at least one element: Palpable content.

    Zero or more occurrences of , , and .

    Specifications

    Browser compatibility

    BCD tables only load in the browser

    See also

    Found a content problem with this page?

    This page was last modified on Apr 13, 2023 by MDN contributors.

    Your blueprint for a better internet.

    MDN

    Support

    Our communities

    Developers

    Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
    Portions of this content are ©1998– 2023 by individual mozilla.org contributors. Content available under a Creative Commons license.

    Источник

    102 CSS Menu

    Collection of free HTML and CSS navigation menu code examples. Update of May 2020 collection. 27 new items.

    Table of Contents

    Author

    Made with

    About a code

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Fullscreen Overlay Navigation Bar

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Transitioning clip-path and pseudo-element transform s to create smooth link hovers.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Fullscreen Overlay Navigation Bar

    Fullscreen overlay navigation bar with html & css neon effect.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Context Menu

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Pure CSS Menu

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Neumorphism Context Menu

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Simple Navigation System

    Simple system for navigating a hierarchy in a confined space. Uses standard HTML and CSS, no JavaScript.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    CSS Menu

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Fullscreen Menu Enter

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Context Menu with Feather Icons

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    CSS Hamburger Menu

    Pure CSS menu interaction. Made using the HTML tags details and summary .

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Text Fill on Hover

    Filling the text with a different color on hover — a creative text effect.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    List Item Hower Effect

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    CSS-Only Marquee Effect

    A simple CSS-only marquee effect for a menu.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    CSS Full-Page Navigation

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Randomly Generated CSS Blobby Nav

    A randomly generated blobby nav created with CSS. Has smooth anchor scrolling, uses backdrop-filter , and SVG filter.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Full-Page Navigation

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Pure CSS Full Page Nav

    Compatible browsers: Chrome, Edge, Firefox (partial), Opera, Safari

    Author

    Made with

    About a code

    Fold Out Mobile Menu

    CSS only fold out mobile menu.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Menu hover fill text ( color + background-clip ).

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Dependencies: bootstrap.css, bootstrap-social.css, font-awesome.css

    Author

    Made with

    About a code

    CSS Navigation Bar

    Implemented a minimal navigation bar that changes color on hovering. Written using only HTML and SCSS.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Apple TV Menu Interface

    Compatible browsers: Chrome, Edge, Opera, Safari

    Author

    Made with

    About a code

    CSS Strange Nav

    Made a strange navigation. CSS only. Let’s Click!

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Off Canvas Menu Pure CSS

    Off canvas menu pure CSS by using only CSS.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About a code

    Vertical Dark Menu with CSS

    Simple vertical dark menu with CSS and icons.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About the code

    Moving Underline Nav Menu

    Compatible browsers: Chrome, Firefox, Opera, Safari

    Author

    Author

    Made with

    About the code

    Usable as navigation, menu or effect. It uses CSS transform and perspective to create a unique hololens-like animation effect.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About the code

    3D Navbar

    3D navbar in HTML and CSS.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About the code

    Just Another Menu

    Pure CSS floating menu animation.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About the code

    Pure CSS Menu

    Pure CSS menu drawer with off-click.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About the code

    CSS Menu Feat. Emoji

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About the code

    The Menu

    Table contents style menu.

    Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

    Author

    Made with

    About the code

    Reverse text color menu effects.

    Compatible browsers: Chrome, Firefox, Opera, Safari

    Demo image: CSS-Only Nested Dropdown Navigation (ARIA)

    Author

    Made with

    About the code

    CSS-Only Nested Dropdown Navigation

    CSS only nested dropdown navigation with ARIA.

    Demo Image: Full Page Off-Canvas Navigation

    Full Page Off-Canvas Navigation

    An example of how to build a full page navigation that exists off of the screen canvas, sliding into view when clicking the menu option. Added spice with a changing background color depending on navigation item hover.
    Made by Caleb Varoga
    June 17, 2016

    Demo Image: Simple Radial Menu

    Simple Radial Menu

    HTML, CSS, JavaScript simple radial menu with social icons.
    Made by Nikolay Talanov
    June 13, 2016

    Demo Image: Simple accordion menu with HTML, CSS and JavaScript

    Accordion Menu

    Simple accordion menu with HTML, CSS and JavaScript.
    Made by JuliaRietveld
    June 8, 2016

    Demo Image: Mobile Filter Menu

    Mobile Filter Menu

    Filter menu created by Anton Aheichanka that has been converted into web version.
    Made by Arjun Amgain
    June 1, 2016

    Author

    Источник

Оцените статью