DEV Community

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

Collapse
 
dmerand profile image
Donald Merand

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 :-)

Collapse
 
akanksha_9560 profile image
Aks

Great starting point. But somehow in working in large team always leaves HTML messy. :(

Collapse
 
dmerand profile image
Donald Merand

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.

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.