Yes! That was news to me too. I made one page that way just to confirm, but generally avoid it since most linting tools will complain, and on some level it just never felt right to leave out the closing tag...
I'm still recovering from the ill-fated XHTML era.
Leaving off the HTML5 optional closing tags will take some getting used to.
But I've gotten used to (and now, I even prefer) leaving off the semicolon in JavaScript when it is superfluous, I'm sure I can do the same in the HTML context.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Reading the Google Style Guide for HTML/CSS really helped me a lot. Like all dogma, it's probably best to take it with a grain of salt :-)
Great starting point. But somehow in working in large team always leaves HTML messy. :(
Is it more true for HTML than, for example, CSS or JavaScript?
It's definitely a good point! We should be considering our HTML templates in our refactoring efforts as well.
Didn't know some HTML5 tags were optional!
Yes! That was news to me too. I made one page that way just to confirm, but generally avoid it since most linting tools will complain, and on some level it just never felt right to leave out the closing tag...
Yeah and also I'm sure some browser will complain 🤣🤣
I'm still recovering from the ill-fated XHTML era.
Leaving off the HTML5 optional closing tags will take some getting used to.
But I've gotten used to (and now, I even prefer) leaving off the semicolon in JavaScript when it is superfluous, I'm sure I can do the same in the HTML context.