DEV Community

Discussion on: What kind of coding standards do you follow when writing HTML?

Collapse
 
rhymes profile image
rhymes • Edited

Didn't know some HTML5 tags were optional!

Collapse
 
dmerand profile image
Donald Merand

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...

Thread Thread
 
rhymes profile image
rhymes

Yeah and also I'm sure some browser will complain 🤣🤣

Collapse
 
eljayadobe profile image
Eljay-Adobe

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.