Is it mandatory to put a closing tag(</li>) in lists(ordered or unordered)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is it mandatory to put a closing tag(</li>) in lists(ordered or unordered)?

5th Jul 2020, 7:25 AM
Shakhboz Razzokov
Shakhboz Razzokov - avatar
3 Answers
+ 4
Shahboz Razzoqov Yes otherwise other list may affect.
5th Jul 2020, 7:26 AM
A͢J
A͢J - avatar
+ 4
Yes it's mandatory to have a closing tag.
5th Jul 2020, 7:55 AM
Nilesh
+ 1
Shahboz Razzoqov Yes it is, as per this spec sheet : https://html.spec.whatwg.org/multipage/syntax.html#void-elements (Void elements can't have any contents (since there's no end tag, no content can be put between the start tag and the end tag)) <-- given in the same page.
5th Jul 2020, 7:30 AM
Hanuma Ukkadapu
Hanuma Ukkadapu - avatar