w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



menuitem nested within elements

Classified as: -

Parents, menuitem

Children, menuitem

Examples: menuitem parents

Valid Syntax 1
1
2
3
4
5
6
7
8
9
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

</body>
</html>
Valid Syntax 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<menu type="popup">
<menuitem>
<menuitem>
</menu>

</body>
</html>
Invalid Syntax 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!doctype html>
<html>
<head>
<title>...</title>
<menuitem>
</head>
<body>

<menuitem>
<p><menuitem></p>
<menu type="toolbar">
<menuitem>
</menu>
<menu>
<menuitem>
</menu>

</body>
</html>

Syntax 1: Valid, menuitem absent; optional element
Syntax 2: Valid, 1 or multiple menuitem element allowed ONLY inside a menu element whose type attribute is "popup"
Syntax 3: Invalid, menuitem nested within head, body, p, menu type="popup": not allowed

Video demonstration nesting menuitem

HTML5 nesting menuitem, Tutorial

min video details
00:06 video tutorial: menuitem element, syntax ⁄ place in page
00:12 syntax menuitem
00:12 adding menuitem element in page
00:14 menuitem element has:

- only the start tag: <menuitem>
- has no end tag; it's a void element
00:18 nesting menuitem
00:18 no element can be nested inside it; has no end tag → no 'inside'
00:21 can be nested only inside menu elements whose type attribute is in the popup state meaning type="popup"
menuitem intro menuitem browser display menuitem syntax