Zac Anger's Blog

Void Elements


Tags: html

Obviously this doesn't apply when using jsx, because everything needs to be closed. But, in jsx, if it can be a self-closed tag (meaning literally any of these but also anything else that doesn't have children), please self-close it.

See what they all have in common?

You can't possibly have anything in any of them, like, between tags. What can you put between an opening and closing line break tag? Nothing. So why would you need a closing tag? You wouldn't. So don't close it.