Comment: This standard requires web page developers to reference valid document types when preparing web pages, and requires them to use the "most current" technology available — for example, the current version of HTML is 4.01. The World Wide Web Consortium (W3C), a collaborative organization of web developers, industry representatives and academicians, develops these technology standards, and publishes them as specifications, or "grammars."
Coding your page to a published formal grammar and declaring that specification at the beginning of a document via a "document type declaration" (DTD) lets the user agent know how to interpret the commands (elements, attributes, semantics, etc.) used to mark up the page. The DTD also lets validation programs know the grammar against which to measure your document. Validation programs check your document's markup against the specification to judge whether or not the structure of the document is sound. The W3C Validation Service validates documents against a whole list of published grammars. See http://validator.w3.org/sgml-lib/catalog for a list.
Since the W3C is the de facto standard-setting body for web-based technologies such as HTML, HTTP, XHTML and XML, validate to W3C grammars. See http://www.w3.org/TR/WCAG10-CORE-TECHS/#access-reviewed for a list of "current" technologies.
The element <DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> is a document type declaration specifying the technology (in this case, which version of HTML) was used in development. This element should always be the first element within any HTML document and is required for all DTD-compliant documents. Although HTML 4.01 has three DTDs (Strict, Transitional, and Frameset), Strict DTDs are preferred, as transitional DTDs allow the use of deprecated elements and attributes (which are discouraged to promote more accessible alternatives) and frameset DTDs allow the use of frames (which are also discouraged).
<!DOCTYPE><DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">Comment: Declaring which published formal grammar was used to mark up your document at the beginning of a document lets the user agent know which rules to use in rendering your document. It also lets the user agent know where to look for semantics if it needs to. This declaration is also what validation programs will use to determine which set of rules to compare your document to in the validation process. The W3C Validation Service validates documents against a whole list of published grammars. (See Standard 3.1 for a link to the W3C published grammars.) Most validation programs will try to validate to W3C grammars.
<!DOCTYPE>
<!DOCTYPE HTML PUBLIC ";//w3c//dtd html 4.01//en" "http://www.w3.org/TR/html40/strict.dtd">font, bold or italic elements are deprecated).Comment: "Deprecated" means the element is still supported for backward compatibility, but its use is discouraged because it may be completely dropped during the next major revision of the standard. An element becomes deprecated when a newer element, a new technique, or a new method of use for an existing element, is developed that duplicated, improves, or supersedes the functionality of an existing element.
Comment: Style sheets separate the content of a web page from presentation attributes. This is a concept widely recommended by experts and widely used by web developers for years. Styles sheets are often discussed in concert with accessibility intiatives because their use segregates the presentational aspects of a web page from the structure and the content. For example, using stylesheets obviates the need for page developers to squeeze their content into HTML tables to enforce some control over its positioning.
Along the same lines and within the context of HTML authoring, the use of style sheets promotes the centralization of presentation, thus allowing the author to change attributes for an unlimited number of documents from a single location. HTML's presentation attributes are quite limited and do not offer the extensive flexibility that style sheets offer. Style sheets promote usability in that centralizing the presentation attributes inherently decreases the size of downloaded documents.
Accessibility specific benefits of using style sheets include:
The W3C developed the CSS 1 and CSS 2 specifications, and has promoted the use of style sheets since their inception.
<html>
<head>
<title>Table Layout Sample</title>
</head>
<body bgcolor="white">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2" valign="top">
<font color="navy">
This is text that spans across the top of the page.
</font>
</td>
</tr>
<tr>
<td width="210" valign="top">
<font color="teal">
A column on the left side.
</font>
</td>
<td valign="top">
<font color="red">
A column on the right side.
</font>
</td>
</tr>
</table>
</body>
</html>
Preferred: <html>
(See a page showing what the code looks like in your user agent [browser].)
<head>
<title>Equivalent CSS Layout Sample</title>
<style type="text/css">
body {
background:white;
}
#leftside {
color:teal;
position: absolute;
left:10px;
width:210px;
}
#rightside {
color:red;
margin-left: 190px;
margin-right:190px;
}
#acrosstop {
color:navy;
}
</style>
</head>
<body>
<div id="acrosstop">
This is text that spans across the top of the page.
</div>
<div id="leftside">
A column on the left side.
</div>
<div id="rightside">
A column on the right side.
</div>
</body>
</html>
For the purposes of illustrating this example, the style sheet has been embedded. Best current practices dictate that the style sheets should be external.
Comment: The lang attribute dictates the base language of an element's attribute values and text content. The overall language for the document is usually specified in the document type declaration (see Standards 3.1 and 3.2 above). This attribute should be used to mark up any elements that deviate from the base language of the page (as specified in the <thml> element).
Language information specified via the lang attribute may be used by a user agent to control rendering in a variety of ways. Some situations where author-supplied language information may be helpful include:
The intent of the lang attribute is to allow user agents to render content more meaningfully based on accepted cultural practice for a given language. For a full list of language abbreviations, see Code for the Representation of the Names of Languages. From ISO 639, revised 1989. (http://www.oasis-open.org/cover/iso639a.html)
<applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, <script>Code Example:
<p>He chose a gaudy diamond and emerald bracelet set in gold and held it up for her perusal. Within a few seconds, though, she smiled and shook her head. She pointed to a plain platinum bangle and smiled. "That will do," she said. "It has a certain <span lang="fr">je ne sais quoi."</span><p>
(See a page showing how your user agent [browser] renders this code.)