Website programming and scripting

XHTML compliance with W3C standards

It is not imperative that a web page be coded according to W3C standards. However, a web page that adheres to W3C standards is deemed to display more uniformly and predictably with different browsers than invalidly coded web pages. However, web pages composed of invalid code usually operate OK, at least on the surface. Nevertheless, it is a good practice to employ valid code, unless there are good reasons not to.

W3C standards

Most current websites are coded according to the HTML 4.01 or XHTML 1.0 Strict or Transitional W3C standards. The new HTML 5 standard is expected to be adopted by more web developers now that its standard is now in its final recommendation stages. Also, XHTML 1.1 is used occasionally and is much the same as XHTML 1.0 Strict.

The W3C makes available numerous documents that have several levels of being adopted as standards. The highest level of them all for a various topic is labeled as a Recommendation, while a lower-level document is generally labeled as a working draft. It often takes several years for a proposed W3C standard to get to the Recommendation status—sometimes a decade or longer. As a rule, only take the W3C Recommendations into consideration because the browser makers will generally only include the recommended features in their newer versions.

The term deprecated often appears in the Recommendations. This alerts the web developers to not employ that particular HTML element or attribute in their websites because the browser makers may choose not to program their newer browsers for deprecated elements or attributes at any time in the future. In addition, deprecated elements or attributes will not test for valid code with the W3C HTML validator. So, if web designers want their code to always be valid, they must not employ any deprecated elements or attributes.

W3C validators

A web page that is compliant with the standards is said to contain valid code when tested with a code-checker known as a validator. There are various validators on the W3C website, in addition to several mirror sites on the Internet. Whenever your web page does not seem to work properly, try checking the page with a validator and then make any appropriate code fixes. Learning how to run a validator is brain-dead simple.

Knowledge of the trends in browser usage and their compliance with W3C standards

The Browser Statistics show the usage percentage of all browsers whose usage is at least 0.5%. The client should be aware of the browser usage trends because programming for low-usage non-compliant browsers adds to the cost and complexity of programming and maintaining the web pages. As of April 2010, it appears that the troublesome Internet Explorer 6 should be around for a couple years, unfortunately...

Formatting with cascading style sheets (CSS)

Website creators use HTML tags (elements) to lend structure to web pages. In the past, various attributes for the HTML elements also determined the webpage’s style and format. However, setting format via XHTML element attributes today is mostly a poor coding practice. Website developers today almost always employ CSS styles and attributes instead of XHTML attributes. In actual fact, many HTML element attributes are now obsolete or going obsolete (deprecated) for current XHTML. Older, obsolete coding often still appears OK in current browsers, but browser support for obsolete or deprecated (invalid) coding might stop at any time in the future by the browser developers.