Taking the Middle Road: Standards-Friendliness

Even when work product can’t stand up perfectly to the test of validation, the good intentions that underlie web standards remain relevant.

The primary goal of standards-friendliness is to allow iterative enhancement of work product, a significant aspect of which is forward compatibility. Standards-friendliness leads to syntactically correct markup in good source order that strictly enforces separation of structure from presentation, while minimizing the amount of time spent struggling with the minutiae of validation. While this practice concedes more to adverse circumstances than many web standards advocates feel is appropriate—since after all, the project sponsor is the one who signs the paychecks—it still yields many benefits.

Benefits of Standards-Friendliness

What do you get in return for the extra effort of a standards-friendly approach?

Standards-friendly deliverables follow the Pareto (80/20) Rule, creating optimal benefit for the amount of time invested

The alternatives are unmaintainable assets, lack of scalability, and inflexibility. Such outcomes increase delivery times over the long term, since there’s little in standards-ignorant work product on which to base modular assets.

Accessible assets become much easier to create

When the source order of content is easily human-readable and developers use appropriate elements—especially lists, in the case of navigation functionality—the result presents few if any challenges for users of assistive technology.

Users of alternative media also benefit from these accessibility improvements

Standards-friendly development offers the best opportunities to apply separate presentation layers to content on a per-media (e.g., screen, print, mobile) basis without being forced to create multiple instances of the same content, saving huge amounts of time and other resources.

Data becomes more portable

When datastores are designed in the spirit of standards-friendliness, their contents can be transformed for use in other information systems, perhaps even systems that aren’t web-based. Microformats advocates are especially ebullient about this benefit.

Rules of Standards-Friendly Development

Following some basic rules of standards-friendly development can simplify creating and developing your sites in the long run:

  1. Avoid presentation-oriented markup (especially inline style attributes) at all reasonable cost.

  2. Keep the source order of page content easily human-readable at all times.

  3. Overbuild markup relating to overall document structure, but otherwise keep markup to the minimum required by the circumstances.

  4. Relegate the use of table markup to data presentation only.

  5. Ensure that all elements are properly closed, nested, populated, and supplied with required attributes; relegate all other validity concerns to a lower priority.

  6. If possible, assign a distinctive id or class (or even one of each) to each body element within a site’s scope, to account for edge cases.

  7. Give all ids and classes names that are driven by context, rather than presentation. If you find yourself unable to follow this rule, you’re probably breaking Rule #1; if you’re able to follow it, you’re probably doing a good job of following Rules #2 and #3.

  8. Always use lists and headings where called for, even though it can be challenging to put the latter inside the former.

  9. Relegate all images intended to provide design accents to the CSS background-image property.

  10. Draft separate stylesheets for Internet Explorer, limited to the scope of addressing layout bugs.

Like all rules, these have their exceptions—and because it de-emphasizes the value of completely valid markup, Rule #5 breaks a few broader rules itself.

The guiding principle of these practices is not perfection but practicality: it’s often impossible to maintain perfect control over the entirety of a complex site, once poor third-party content and other flaws are taken into account.

Get HTML & CSS: The Good Parts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.