Chris Coyier [blogged recently on weird looking HTML](https://css-tricks.com/some-html-is-optional/). It’s a nice short post and I’d say it’s worth knowing these optional features (potentially known as defaults). My favourite optional is <script> and not having to include the type attribute.

But Chris' first example is the most common, the optional closing </p> tag. What (I think) is an interesting question is: why?

[I’ve published 38 videos for new developers, designers, UX, UI, product owners and anyone who needs to conquer the command line today.](https://training.leftlogic.com/buy/terminal/cli2?coupon=BLOG\&utm_source=blog\&utm_medium=banner\&utm_campaign=remysharp-discount)

The easy answer[](#the-easy-answer)

HTML has an amazing quality: it’s super-dooper backwards compatible. It’s why we have HTML5 and not XHTML2.

This backward compatibility means that devices and browsers reaching all the way back to the very first browser are still able to render HTML (just about - the first makes a bit of mess of unknown elements but that’s more of an exception).

So if you ever find yourself asking why, the answer will nearly always lay in the past and original functionality.

This same reasoning also explains why you’ll never find a newly introduced element to go inside the <head> element - but I’ll leave that for someone else to blog about…

Performance and optimisation?[](#performance-and-optimisation)

Without looking at modern day browsers' HTML parsing algorithms, I’m guessing the perf cost is incredibly minute. So minute that it makes no difference that we mortal users could experience.

Compression is really a moot point too, it’s a micro optimisation that may save a byte or two, but because of how repeating sequences are compressed, a closing </p> won’t have an impact.

But, what exactly about this <p> tag?

Back to 1989[](#back-to-1989)

Pre-DOM, pre-browsers, the world’s first browser was being written by Sir Tim Berners-Lee.

There was no reference implementation and certainly no such thing as a parsing specification.

The first browser, the [WorldWideWeb.app](https://worldwideweb.cern.ch), parsed HTML character by character applying styles as it went along. As opposed to today’s methods whereby a document object model is built up, then rendered.

I happened to be lucky enough to be sat next to [Kimberly Blessing](https://www.kimberlyblessing.com/) when they unearthed the parsing algorithm for the <p> tag.

In fact, Chris' earlier example of paragraph text should be reformatted to truly see how the paragraph was intended to be used:

<P>
Paragraph one.
<P>
Paragraph two.
<P>
Paragraph three.

The paragraph tag (yes, in upper case) was intended to separate paragraphs, not wrap them.

Which is why you don’t need a closing tag, to support this original use and support existing documents around the web.

Here’s a photo I took of Kimberly’s screen showing the source:

![paragraph formatting](/images/p-tag.jpg)

Pretty geeky, and for some reason, I love these historical details.

👍 69 likes

[![Tristan Web Expert](/images/no-user.svg "Tristan Web Expert")](![Raymond Schwartz(/images/no-user.svg "Raymond Schwartz")](![Jason Neel(/images/no-user.svg "Jason Neel")](![Cloudguru(/images/no-user.svg "Cloudguru")](![Kacper Kucinski(/images/no-user.svg "Kacper Kucinski")](![thomas(/images/no-user.svg "thomas")](![Esraa(/images/no-user.svg "Esraa")](![Winardi(/images/no-user.svg "Winardi")](![Farai Gandiya(/images/no-user.svg "Farai Gandiya")](![Bill Altorfer(/images/no-user.svg "Bill Altorfer")](![Timothy Miller(/images/no-user.svg "Timothy Miller")](![Glenn Smith(/images/no-user.svg "Glenn Smith")](![Queen T.(/images/no-user.svg "Queen T.")](![Mayka 🦇 ✨(/images/no-user.svg "Mayka 🦇 ✨")](![Mike Sharp(/images/no-user.svg "Mike Sharp")](![Batbayar B.(/images/no-user.svg "Batbayar B.")](![Bill Criswell(/images/no-user.svg "Bill Criswell")](![A Book Apart(/images/no-user.svg "A Book Apart")](![James Wragg(/images/no-user.svg "James Wragg")](![litenjacob(/images/no-user.svg "litenjacob")](![jail(/images/no-user.svg "jail")](![Miguel Piedrafita 🛸(/images/no-user.svg "Miguel Piedrafita 🛸")](![Sid Vishnoi(/images/no-user.svg "Sid Vishnoi")](![Stefan Krieger(/images/no-user.svg "Stefan Krieger")](![مختار(/images/no-user.svg "مختار")](![Mickaël Isaert(/images/no-user.svg "Mickaël Isaert")](![Donald Pipowitch(/images/no-user.svg "Donald Pipowitch")](![Menno van Slooten(/images/no-user.svg "Menno van Slooten")](![Mohamed Aly 📌(/images/no-user.svg "Mohamed Aly 📌")](![Jelmer de Maat(/images/no-user.svg "Jelmer de Maat")](![Marlon Barcarol(/images/no-user.svg "Marlon Barcarol")](![Kashyap(/images/no-user.svg "Kashyap")](![Benny Schudel(/images/no-user.svg "Benny Schudel")](![Dinesh(/images/no-user.svg "Dinesh")](![Joe // 康乔(/images/no-user.svg "Joe // 康乔")](![HelloEdit(/images/no-user.svg "HelloEdit")](![Praveen Puglia(/images/no-user.svg "Praveen Puglia")](![adam lord(/images/no-user.svg "adam lord")](![Josh Buchea(/images/no-user.svg "Josh Buchea")](![Karan Ganesan(/images/no-user.svg "Karan Ganesan")](![Sailor Saturn(/images/no-user.svg "Sailor Saturn")](![James Vibar(/images/no-user.svg "James Vibar")](![MrBliz(/images/no-user.svg "MrBliz")](![Natty Beel(/images/no-user.svg "Natty Beel")](![MI Web Guy(/images/no-user.svg "MI Web Guy")](![Leila Kiss(/images/no-user.svg "Leila Kiss")](![Anthony Young(/images/no-user.svg "Anthony Young")](![Raz(/images/no-user.svg "Raz")](![Rory Molyneux(/images/no-user.svg "Rory Molyneux")](![Víctor de la Gala(/images/no-user.svg "Víctor de la Gala")](![Chris Watson(/images/no-user.svg "Chris Watson")](![HTeuMeuLeu(/images/no-user.svg "HTeuMeuLeu")](![Matteo Fogli(/images/no-user.svg "Matteo Fogli")](![Haroen(/images/no-user.svg "Haroen")](![Arun Kumar Dadhwal(/images/no-user.svg "Arun Kumar Dadhwal")](![Romina Herrera(/images/no-user.svg "Romina Herrera")](![JSCamp(/images/no-user.svg "JSCamp")](![Meligy, GuruStop, ng-sydney(/images/no-user.svg "Meligy, GuruStop, ng-sydney")](![Matt Styles(/images/no-user.svg "Matt Styles")](![doןɟɐɹɹǝʇ@(/images/no-user.svg "doןɟɐɹɹǝʇ@")](![Ilya Streltsyn(/images/no-user.svg "Ilya Streltsyn")](![feminism & sharks(/images/no-user.svg "feminism & sharks")](![Kyle Roach 👨🏽‍💻(/images/no-user.svg "Kyle Roach 👨🏽‍💻")](![Franco Arz(/images/no-user.svg "Franco Arz")](![Mark Boulton(/images/no-user.svg "Mark Boulton")](![Paul Bastowski(/images/no-user.svg "Paul Bastowski")](![Juan Olvera 🇲🇽 🌮(/images/no-user.svg "Juan Olvera 🇲🇽 🌮")](![2.4B others(/images/no-user.svg "2.4B others")](![Dara Hak(/images/no-user.svg "Dara Hak")](https://twitter.com/Akasuna)

Comments