So, I was learning about lists in HTML at college and the professor said <li>
doesn't have an ending tag </li>
along with some other tags like <img>
and <br>
. Is that correct or not? Because I've seen a lot of templates / themes using
The li
element has an end tag (</li>
), but it’s optional in some cases:
An
li
element's end tag may be omitted if theli
element is immediately followed by anotherli
element or if there is no more content in the parent element.