Foreword

Validating HTML was cool during the XHTML era, but developers largely forgot about this tool for quality since. Jens makes the case that it’s an essential tool, and I agree. Quality improves because a conformance checker will catch mistakes such as typos or missing tags, or usage of elements or attributes that are obsolete.

Optimizing and minimizing HTML and checking if there are more appropriate elements or attributes to use is a helpful exercise, because it can improve accessibility while you learn about new features. HTML is also evolving—there are probably features you didn’t know existed, or maybe you had the wrong idea about the appropriate use for an element that has been around forever. Your HTML skills should improve if you adopt a habit of being critical of the code you write or maintain, and read about the relevant features in MDN and the HTML standard.

Another aspect of consideration that Jens touches on is syntax. If you have the habit of writing HTML with XHTML-like syntax, you might be a bit uncomfortable with omitting the slash in void elements (e.g., <br>), or omitting tags. But the parsing rules for HTML are well-defined, and are interoperably implemented in browsers. So long as you understand and follow the rules, and check your work with a conformance checker, there is no problem with omitting tags. After doing it for a while, maybe you’ll start to like the minimalist style, and go ahead and remove optional code.

Get ready to upgrade your HTML.