!–– –– nested within elements, elements nested within !–– ––
Classified as: -
Parents, comment
Children, comment
Examples: comment parents, comment children
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <!doctype html> <> <> <>...</> < </> <> < <> < </> <> < </> <> < </> ... </> </> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <!doctype html> <> <> <>...</> </> <> < <>...</> <>...</> <>...</> <>...</> <> ... > </> </> |
Syntax 1: Valid, comments can be added inside any element, except void elements (void elements e.g. img, link, hr,.. See the Parents list above)
Syntax 2: Valid, all HTML5 elements can be commented