You are not required to close your <p>, <li>, <img>, or <br> tags in HTML

Are you an author writing HTML?

Just so we’re clear: Not XHTML. HTML. Without the X.

If you are, repeat after me, because apparently this bears repeating (after the title):

You are not required to close your &lt;p>, &lt;li>, &lt;img>, or &lt;br> tags in HTML.

↫ Daniel Tan

Back when I still had to write OSNews’ stories in plain HTML – yes, that’s what we did for a very long time – I always properly closed my tags. I did so because I thought you had to, but also because I think it looks nicer, adds a ton of clarity, and makes it easier to go back later and make any possible changes or fix errors. It definitely added to the workload, which was especially annoying when dealing with really long, detailed articles, but the end result was worth it.

I haven’t had to write in plain HTML for ages now, since OSNews switched to WordPress and thus uses a proper WYSIWYG editor, so I haven’t thought about closing HTML tags in a long time – until I stumbled upon this article. I vaguely remember I would “fix” other people’s HTML in our backend by adding closing tags, and now I feel a little bit silly for doing so since apparently it wasn’t technically necessary at all. Luckily, it’s also not wrong to close your tags, and I stick by my readability arguments.

Sometimes it’s easy to forget just how old HTML has become, and how mangled it’s become over the years.

5 Comments

  1. 2026-01-12 10:52 am
    • 2026-01-12 11:38 am
      • 2026-01-12 12:14 pm
  2. 2026-01-12 2:23 pm
    • 2026-01-12 3:01 pm

Leave a Reply