Why are some tags self-closing whereas others are not?


#1

Question

Why are some tags self-closing (<img>, <br>, etc.) whereas others are not ?

Answer

The important distinction between self-closing tags and all other tags is that self-closing tags represent void elements. Void elements like <img> and <br> cannot contain any content. All other tags may (but are not required to) contain content.