Document Structure
From Library
HTML and related technologies supported by the web are established by the World Wide Web Consortium (W3C) and are documented as standards for structured markup languages. These standards are the common languages that allow the web to be truly worldwide. In order to make sure that New York State agency web pages are accessible to the widest possible audience, it is important for developers to ensure that these documents adhere to published standards.
STANDARD 3.1
Web pages will be created using the most current web document specification (e.g., HTML, XML, XHTML).
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."http://www.lighthouse.org/color_contrast.htm
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 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 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).
HTML Elements Affected: <!DOCTYPE>
Code Example:
<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
STANDARD 3.2
All web pages will include a valid document type declaration (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.
HTML Elements Affected: <!DOCTYPE>
Code Example:
<!DOCTYPE HTML PUBLIC ";//w3c//dtd html 4.01//en" "http://www.w3.org/TR/html40/strict.dtd">
STANDARD 3.3
The use of deprecated elements or attributes is not allowed (e.g., the usage of blockquote element simply to indent text is 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.
HTML Elements Affected: See Deprecated HTML 4.0 (4.01) Elements, a document published by the NYS Forum Accessibility Committee, for a complete list of items that have been deprecated or discouraged in HTML 4.01.
Code Example:
Deprecated HTML 4.0 (4.01) Elements, a document published by the NYS Forum Accessibility Committee.
STANDARD 3.4
Web pages will be created using style sheets to achieve formatting and stylistic effects whenever possible. When style sheets are utilized the web pages must convey all relevant information in an accessible manner if the style sheet is disabled for any reason.
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: + Properties to control font appearance allow authors to eliminate inaccessible bit-mapped text images. + Positioning properties allow authors to eliminate mark-up tricks (e.g., invisible images) to force layout. + The semantics of !important rules mean that users with particular presentation requirements can override the author's style sheets. + The 'inherit' value for all properties improves cascading generality and allows for easier and more consistent style tuning. + Improved media support, including media groups and the braille, embossed, and tty media types, will allow users and authors to tailor pages to those devices. The W3C developed the CSS 1 and CSS 2 specifications, and has promoted the use of style sheets since their inception.
Code Example:
Discouraged: See a page showing what the code looks like in your user agent (browser).
<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:
See a page showing what the code looks like in your user agent (browser).
<html>
<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>
<nowiki>
<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.
STANDARD 3.5
All natural language usage will be clarified using the LANG attribute when the written language is not English.
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: + Assisting search engines + Assisting speech synthesizers + Helping a user agent select glyph variants for high quality typography + Helping a user agent choose a set of quotation marks + Helping a user agent make decisions about hyphenation, ligatures, and spacing + Assisting spell checkers and grammar checkers
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.
HTML Elements Affected (may include deprecated tags): All elements except <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.
Additional Commentary
When a contractor sets out to build a house, he uses the architect's blueprint to make sure his crews build the structure that the architect designed. There are different versions of the blueprints, for example, for the electricians, the plumbers, the carpenters, and the landscapers. But all are based on that original blueprint.
The web is much like that house. As long as you let browsers and other user agents know which blueprint you are working with, it's more likely that what you intend will be what your visitors experience. Behind this concept is the principle of the standard. The W3C is the de facto standard setting body for the web, and they set these standards in the form of specifications. There is at least one specification document for each flavor of HTML, XHTML, CSS, and XML, often there is more than one (for example, a 'loose' version, a 'transitional' version, and a 'strict' version in the case of HTML 4.01).
Web pages will be created using the most current web document specifications (e.g., HTML, XML, XHTML).
With certain exceptions, you would not create a page today using a specification earlier than HTML 4. However, there are variations between HTML 4.0 and HTML 4.1, and between HTML and XHTML. Specifying which version of the specification you are using will help the browser – and consequently the screen reader – render your page faithfully
All web pages will include a valid document type declaration (DTD).
You can improve accessibility by ensuring browsers and screen readers know how to correctly interpret your code. The best way of providing this information is to include a Document Type Definition at the very top of your document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
This tells the browser that you are using the W3C's implementation of HTML 4.01, that the native language of your document will be English, and you have provided the URL to the version of HTML you will be using. You need to include one of these at the top of each document.
The use of deprecated elements or attributes is not allowed (e.g., the usage of FONT, BOLD & ITALICS are deprecated).
One of the problems facing early web developers was the lack of mechanisms for formatting text without bloating your pages with redundant formatting codes. The W3C proposed the use of 'cascading style sheets,' or CSS, to remove purely presentational markup from pages. This strategy had the added benefit of allowing "code once, use anywhere" benefits for presentational markup. With one style sheet, accessed by all the site's pages, you could ensure uniform formatting and you could change a font-color or some other attribute of an element and the change would cascade throughout the site.
In an effort to steer developers toward cascading style sheets, the W3C deprecated most of the elements and attributes within HTML that were solely presentational in nature. It is reasonable to assume that within the foreseeable future, browser manufacturers may begin to omit support for elements and attributes that are no longer an official part of the specification.
Web pages will be created using style sheets to achieve formatting and stylistic effects whenever possible. When style sheets are utilized the web pages must convey all relevant information in an accessible manner if the style sheet is disabled for any reason.
This sub-standard comes into play when developers do such things as present information in a background graphic, or provide navigation via styled lists. Whatever method you use to provide this information, you need to ensure that if you turn off style sheets in your browser, the information is still available.
All natural language usage will be clarified using the Lang attribute when the written language is not English.
Based on the DTD example used in Standard 3.2 above, it is understood that the natural language of the document is English (EN). It is therefore expected that all text in the document will be written English. If one of the persons you're writing about quotes a French philosopher in French, then the text in French should be enclosed in <lang=" "> elements and the language to be used should be provided.
