Don’t use /> in HTML ๐ซ!
I always thought I needed to close HTML tags properly, even for tags like <br/>๐ท๏ธ.
It was in the hype around 2000s when the idea was that XHTML was the future. I was one of the first to pick this up and try to make my web pages validate as XML๐.
My blog was at that time, but it needed to be monitored closely because one mal typed character could fail the parsing๐ป.
Then for me and many others the realization came that the World Wide Web was so great, because HTML parsers were so permissive๐ก.
Being strict would have killed the Web!
From that time, I picked up on the habit of closing HTML tags, like <br/>. This is required in XHTML but it isn’t for HTML๐.
This week I read the article by Jake Archibald: ‘The case against self-closing tags in HTML’ https://jakearchibald.com/2023/against-self-closing-tags-in-html/ ๐ฐ
It made me realize that I had been doing it wrong all those years๐ญ.
<br> is the correct wayโ !
Even an old-timer like me can update their mental software! ๐๐ง