li nested within elements, elements nested within li
Classified as: -
Parents, li
Children, li
Examples: li parents, li children
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <!doctype html> <> <> <>...</> </> <> <> <>...</> <>...</> </> <> <>...</> <>...</> </> < type="toolbar" > <>...</> <>...</> </> </> </> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!doctype html> <> <> <>...</> <>...</> </> <> <> <>...</> </> <>...</> </> </> |
Syntax 1: Valid, li elements can be nested only inside: ol, ul, menu;
Syntax 2: Invalid, li elements nested within head, p, body: not allowed
Video demonstration nesting li
HTML5 nesting li Tutorial
min | video details |
---|---|
00:05 | li element cannot be added in head section, only in body section |
00:11 | once or multiple times |
00:17 | AND ONLY inside any of the next 3 HTML elements: ul ol menu |