Web standards and guidelines

Accessibility: Coding and testing

Cartoon image of a lightbulb

CSS

Use style sheets to control presentation and layout and use mark-up to provide structure. More information on CSS and accessibility can be found in our pages on visual guidelines for accessibility.

JAVASCRIPT

Do not use JavaScript to redirect the user to another page. Use server-side programming to do this.

HTML

Websites developed for Learning and Teaching Scotland should be coded using Extensible HyperText Markup Language (XHTML). XHTML is a strict form of HTML markup. This requires tags to be in lowercase and all tags to be closed correctly. Refer to the W3C site for details of the standard XHTML 1.0: The Extensible HyperText Markup Language.

The W3C provides an online XHTML validation service which should be used to check all web pages in your site to ensure that they comply with W3C standards. Make sure that each web page contains a Document Type Definition (DTD) - pages without DTDs automatically fail to validate as there is no way of knowing which standard the page is supposed to be following. Developers should use the following DOCTYPE as a template for all XHTML documents.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

The code above identifies that we are coding to XHTML 1.0 Transitional. It is expected that this is the minimum that developers should be coding against and that wherever possible developers should coding against XHTML 1.0 Strict.

Developers should also include a Character Encoding. This helps overseas visitors display our character sets correctly or for search engines to index our content. Note: for sites written using UK English the character encoding will usually be iso-8859-1, which is commonly used in Western Europe, for example:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Stylesheets must also be validated. Use the W3C CSS Validation Service.

Technical development

Our Technical development section has more detail on technical standards for creating and delivering online content.

Updated on: 26 February 2008 The LTS Online Service is funded by the Scottish Government.