The 3 Basic Rules for Writing HTML - Study24x7
Social learning Network

The 3 Basic Rules for Writing HTML

Updated on 22 May 2020
study24x7
HTML and CSS
7 min read 1 views
Updated on 22 May 2020

1. Respect Syntax and Semantics


In other words: Validate your code and use markup according to its purpose. For validation there are validators, and both syntax and semantics are explained in specifications. Many advantages spring out of respecting syntax and semantics. Most notably, avoiding a few accessibility pitfalls and being professional.


2. Don’t Use Presentational or Behavioral Markup


In other words: Avoid presentational and behavioral elements and attributes, avoid presentational and behavorial ID and class names, avoid linking off to too many style sheets and scripts, avoid screwing up file names, &c. pp. Markup changes continue to be most expensive. Separation of concerns is the only option you have to write markup that is reusable and maintainable.


3. Leave Everything Out That Is Not Absolutely Necessary


In other words: Leave everything out that is not absolutely necessary. Question everything. Just using the markup you really need sounds easy but, unfortunately, it’s not. It requires experience and expertise. When questioning everything and omitting even more, look into syntactical opportunities, too (protocol-less URLs, optional tags, unquoted attribute values, &c.). Once comfortable with the techniques, welcome not only performance but also maintainability benefits.

study24x7
Write a comment...