HTML <menu> tag

HTML <menu> tag specifies a list or menu of commands that a user can perform or activate. It is used for creating context menu as well as lists menu.

A <menu> element can contain one or more <li> or <menuitem> elements within it.

Note: The <menu> tag was deprecated in HTML 4.01 and again included in HTML 5.1 specification. But it will better to ignore it as it is experimental and not supported by many browsers.

Syntax

<menu>........<menu>  

Following are some specifications about the HTML <menu> tag

DisplayInline
Start tag/End tagBoth Start and End tag
UsageSemantic and textual

Example

   

    <!DOCTYPE html>  
    
      <html>  
    
     <head>  
    
      <title>Menu Tag</title>  
    
      </head>  
    
      <body>  
    
      <h2>Example of Menu Tag</h2>  
    
     <menu>  
    
        <li>Home</li>  
    
        <li>Registration</li>  
    
        <li>Contact-us</li>  
    
        <li>About-us</li>  
    
     </menu>  
    
    </body>  
    
    </html>

    Output:

    HTML menu tag

    Attribute:

    Tag-specific attributes:

    • popup
    • toolbar
    • context
    AttributeValueDescription
    labelHTML Tags ListtextIt specifies the label for the menu.
    typeHTML Tags ListIt specifies the type of the menu in an HTML document.

    Global attribute:

    The <menu> tag supports the global attributes in HTML

    Event attribute:

    The <menu> tag supports the event attributes in HTML.

    Supporting Browsers

    Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
    <menu>NoNoYesNoNo


    Comments

    Leave a Reply

    Your email address will not be published. Required fields are marked *