Contents

  1. Introduction
  2. History
  3. Web Standards
  4. Structure and presentation
  5. (X)HTML
  6. CSS
  7. Accessibility
  8. URLs
  9. References
  10. Glossary

3. Web standards

What are web standards?

Web standards are technologies, established by the W3C and other standards bodies, that are used to create and interpret web-based content. These technologies are designed to future-proof documents published on the Web and to make those documents accessible to as many as possible.

Structural languages

Presentation languages

Object Models

Scripting languages

This document focuses on XHTML 1.0 Strict for structure, CSS Level 1 and Level 2 for presentation, and ECMAScript 262 for scripting (not that there are a lot of scripting examples).

When a document is said to adhere to web standards, it means that the document, besides using the above technologies:

Note that “works in any web browser” does not mean “looks the same in every web browser”. Making a document look identical across browsers and platforms is next to impossible. Not even using only images will make a website look exactly the same everywhere. Documents that are published on the web will be accessed by a wide variety of browsing devices on several operating systems, with monitors of differing size and quality (or no monitor at all), by users who may have changed their browser’s default text size and other preferences. Accepting this will make your life a lot less frustrating. Anyone who creates websites needs to understand that there are technical prerequisites to consider, the same way as those who publish on paper or make movies or television have other prerequisites to consider.

Why use web standards?

Certain web developers and web designers have a resistance towards using web standards. Common arguments are It’s too difficult, It works anyway and The tools I use create invalid code.

It’s easy to react emotionally and build up a resistance towards learning something new and abandoning techniques you know and feel comfortable with. However, if you look at the situation logically you will see that there are many benefits to learning and using web standards. A few examples:

Web standards can save time and money for website creators, and provide a better experience to the website’s visitors. Besides, web standards is the future. If you’re not using web standards already, now is the time to start, or you will risk being left behind.

Read more:

Validation

Validation is the process of controlling that a document obeys the rules of the language used in the document. You can compare it to checking a text for spelling and grammatical errors.

Validation is an important part of web development. Many errors that are hard to find are discovered during validation. An error can be as trivial as a typo, or as serious as an element or attribute being used in an invalid way.

Unfortunately, many people don’t validate their documents. Some people may not know about validation, others forget to validate, and there are those who intentionally avoid validating. This situation can largely be blamed on web browser vendors. Most web browsers attempt to interpret invalid HTML as best they can, and try to guess what the author’s intention is, instead of displaying an error message. This behaviour has led to the sloppy markup that is very common today. The problem with that kind of markup is that it gives unpredictable results and relies on the error handling of web browsers.

There is no reason not to validate your HTML and CSS. On the contrary. There are only benefits.

Why we won’t help you is Mark Pilgrim’s excellent explanation of the advantages of validation. The article also explains why it may be harder to get help from people on discussion forums and mailing lists if you haven’t validated your documents before asking for help.

Several HTML editors, like for instance BBEdit and Homesite, have built-in validation tools. If your development tool doesn’t have built-in validation, you can use the W3C’s validation services, available online:

Understanding the error messages generated by the validators can be a little tricky. An error early in a document may cause several additional errors. By fixing the first error and revalidating you will often greatly reduce the number of errors.

It is always a good idea to make sure your code is fully valid, but there are a few occasions when some validation errors are difficult to avoid. The most common example is embedding Flash, or other content that requires a plugin, in a document. Read more about the problems with Flash in Flash Satay: Embedding Flash While Supporting Standards, and Embedding flash without <embed>.

Comments, questions or suggestions? Please let me know.

© Copyright 2004–2006 Roger Johansson