HTML Development Standards



COMMONWEALTH OF PENNSYLVANIA

DEPARTMENT OF Human Services

INFORMATION TECHNOLOGY GUIDELINE

|Name Of Guideline: |Number: |

|HTML Development |GDL-EASS017 |

|Domain: |Category: |

|Application |Guidelines |

|Date Issued: |Issued By: |

|06/29/2001 |DHS/Bureau of Information Systems |

|Date Reviewed: | |

|02/17/2016 | |

Table of Contents

Introduction 4

Priority 1 5

Priority 2 5

Priority 3 5

Purpose 5

Document Change Log 6

HTML Development Guidelines 7

Simplicity and Consistency 7

Page Content 7

Accessibility Consideration 8

Text equivalent to non-text or abbreviated content 8

Image Maps 9

Tables 9

Client Side Image Maps 9

Fonts and Text Presentation 10

Coloring Schemes and Backgrounds 10

Graphics 11

Design for Device Independence 11

Mandatory and Optional Fields 11

Links 11

Testing ADA Compliance 12

Understanding Bobby 12

Test Process with Bobby 12

Understanding Wave 12

Test Process with Wave 12

Testing ASPs for Accessibility 13

Relative Links 13

Usage of CSS1 13

Deprecated Tags 13

Style Sheets and Images 14

Form Elements 14

Naming Standards 16

Check Boxes 16

Command Buttons 17

List Boxes 17

Radio Buttons 17

Text Fields and Labels 18

Hidden Form Fields 18

Submit Method 18

DOs and DON’Ts 19

Cookies 19

Frames 19

Others 19

Screen Resolution Considerations 19

Usage of JavaScript 19

Multi Browser Capability 20

HTML Development

Introduction

This document describes the World Wide Web Consortium (W3C) accessibility guidelines and the Internet accessibility design guidelines explained by the Office of Information Technology (OIT) in the Commonwealth of Pennsylvania. If all the standards and guidelines in this document are followed the web page/application should be ADA compliant. However, a large part of ADA compliance lies in user checks that have no strict guidelines to follow. The W3C handbook and a little legwork during the design phase is the best recipe to make pages visually appealing and equally accessible.

This standards document reflects our experience and lessons learned in developing web applications. Designing web applications has given us experience in document creation, graphic design, user interface design, information design, and the technical authoring skills required to optimize the HTML code, graphics, and text within web pages. This document shares our experiences and provides an instrument to embed this experience into your web project.

The web application will be constructed with Microsoft Active Server Pages (). This solution allows developers to construct business and presentation logic rapidly right along side HTML presentation markup. allows logic to be constructed with a variety of languages, the most common being Microsoft Visual Basic. The presentation layer of the application can be enhanced by implementation of Cascading Style Sheets and Javascript. In this document, we will introduce standards to leverage best practices consistently throughout the application.

The ultimate goal for the Web application is to facilitate the sharing, exchange and gathering information with a targeted audience. However, there is a possibility that many members of this audience may not use computers and software in the same manner. Following the standards and guidelines in this document is essential to achieve the goal of serving special needs of the disabled community and the principles of accessible Web design.

The checkpoint definitions in each guideline in this document explain how the guideline applies in typical content development scenarios. Each checkpoint is intended to be specific enough so that someone reviewing a page or site may verify that the checkpoint has been satisfied. Each checkpoint has a priority level assigned by the Working Group based on the checkpoint's impact on accessibility.

Priority 1

A Web content developer must satisfy this checkpoint. Otherwise, one or more groups will find it impossible to access information in the document. Satisfying this checkpoint is a basic requirement for some groups to be able to use Web documents.

Priority 2

A Web content developer should satisfy this checkpoint. Otherwise, one or more groups will find it difficult to access information in the document. Satisfying this checkpoint will remove significant barriers to accessing Web documents.

Priority 3

A Web content developer may address this checkpoint. Otherwise, one or more groups will find it somewhat difficult to access information in the document. Satisfying this checkpoint will improve access to Web documents. Some checkpoints specify a priority level that may change under certain (indicated) conditions.

W3C defines three levels of conformance for a web page:

• Conformance Level "A": all Priority 1 checkpoints are satisfied.

• Conformance Level "Double-A": all Priority 1 and 2 checkpoints are satisfied.

• Conformance Level "Triple-A": all Priority 1, 2, and 3 checkpoints are satisfied.

The web application that is built with the standards and guidelines mentioned this document targets a “Triple A” level conformance.

The first section describes the accessibility considerations that include of usage of specific tags, ways to specify alternative to visual content, coloring schemes, backgrounds and overall look and feel. It also explains how to use the Cascading Style Sheets (CSS) and how to test the page developed for ADA compliance.

The other section talks about what is necessary to make the application work in multiple browsers, the type of navigational interface that will be used for building the user interface, the language level that will have to be used for the application. Towards the end, this document contains the templates that can be used to code the windows, the tools that will be used during the development process.

Purpose

The purpose of this document is to provide developers with HTML development standards and guidelines.

Guideline Change Log

|Change Date |Version |CR # |Change Description |Author and Organization |

|06/29/01 |1.0 |N/A |Initial creation. |Deloitte Consulting |

|12/12/02 |1.1 |0353 |Applied document to H-Net style template. |Beverly Shultz |

| | | | |Diverse Technologies |

| | | | |Corporation / Deloitte |

| | | | |Consulting |

|10/16/2013 |1.2 |0354 |Updated to reflect changes to web development platforms |Bradley Deetz |

| | | |and web browsers | |

|02/17/2016 |1.3 |NA |Updated to reflect agency name change |Bradley Deetz |

HTML Development Guidelines

Simplicity and Consistency

Users will not be impressed with complexity that seems gratuitous, especially users who may be depending on the site for timely registration. The interface metaphors must be simple, familiar and logical to the registrant. For maximum functionality and legibility the page and site design will be built with a consistent pattern of modular units, all sharing the same basic layout grids, graphic themes, conventions, and hierarchies of organization. The goal is to be consistent and predictable, so that users will feel comfortable exploring the site, and confident that they know how to find what they are looking for.

The graphic identity of a series of pages in the web site will provide visual cues to the continuity of information. The header menu graphics present on every page will create a consistent user navigation interface.

Page Content

Pages are the screens presented to a user in a web application. Pages contain the graphical and text controls that allow the user to interact with the application. The guidelines for page content are below:

• Organize pages and dialogs to match work flow - Which pages, how much they do, and the order they are in, must match how the users are doing their work.

• Use an appropriate amount of information - Each page or dialog will represent one task or subtask in the user’s work flow. If a task is complicated, more than one page will be used—one for each subtask.

• Organize information within a page - Information is placed in a page so that it flows well with the task the users have to perform. The most common or critical information will be at the top left of the page. The flow of the page then moves from top to bottom or left to right.

• Choose a vertical flow for all pages - Vertical flow starts in the upper left and moves down.

• Group similar data together - Use white space to show the groupings.

• Minimize different margins - Line up data elements and groups to minimize the number of different margins on the screen.

• Error messages will be placed near the top of each page, below the title, and before general page content.

Accessibility Consideration

Text equivalent to non-text or abbreviated content

A text equivalent should be provided for every non-text element (e.g., via "alt", "longdesc", or in element content). This includes: images, graphical representations of text (including symbols), image map regions, animations (e.g., animated GIFs), applets and programmatic objects, scripts, images used as list bullets, spacers, graphical buttons.

Text is considered accessible to almost all users since it may be handled by screen readers, non-visual browsers, and braille readers. It may be displayed visually, magnified, synchronized with a video to create a caption, and so on As you design a document containing non-textual information (images, applets, sounds, multimedia presentations, and so on), supplement that information with textual equivalents wherever possible.

When a text equivalent is presented to the user, it fulfills essentially the same function (to the extent possible) as the original content. For simple content, a text equivalent may need only describe the function or purpose of content.

• Element: IMG

• Requirement: Valid "alt" attribute.

▪ "alt" attribute must exist

▪ Not allowed - NULL "alt" value (alt="")

▪ Allowed - "alt" value of 1 or more characters ("alt="xx"") but only if image is not within an "A element". “alt” value should always be descriptive in nature, and never serves as merely a placeholder.

▪ Suspicious - "alt" attribute value could be file size (ends with "bytes")

▪ Suspicious - "alt" attribute value ends with image file suffix.

▪ Suspicious - "alt" attribute value is placeholder text.

▪ Suspicious - "alt" attribute value is longer than 150 characters. Suggest that a description file be created.

▪ Valid "longdesc" attribute or a d-link required if describing the image will add information not given in the text of the page. The amount of information in the image and the context in which it is used will determine how detailed the description should be. Note: d-link now deprecated.

▪ Valid "longdesc" attribute is any valid URL

Image Maps

Image maps should not be used to create graphical submit buttons.

• Element: INPUT type="image"

• Requirement: Valid "alt" attribute.

▪ "alt" attribute must exist

▪ Not valid - NULL "alt" value (alt="")

▪ Not valid - "alt" value of 1 or more spaces (alt=" "). “alt” value should always be descriptive in nature, and never serves as merely a placeholder.

Tables

If a table is used to display data, structural markup must be used to identify the logical order that table data are to be rendered. Structural markup does not apply to tables used strictly for layout. The row and column header must be identified for the data table. The table should provide a summary using the summary attribute of the element.

• Element: Table

• Requirement: table must have at least one complete row or column of headers ().

• Requirement: use THEAD, TFOOT, and TBODY to group rows, COL and COLGROUP to group columns, and the "axis", "scope", and "headers" attributes, to describe more complex relationships among data

• Requirement: table must contain relative sizing Width must be set as a percentage of the screen (width=”100%”)

• Not valid - width attribute within the , , or tags.

• Not valid – absolute width (width=”640”)

Client Side Image Maps

Until user agents render text equivalents for client-side image map links, provide redundant text links for each active region of a client-side image map.

• Element: IMG usemap

• Requirement: Document must contain text links for each active area of the image map.

• Associated text links may be found by searching the document for anchors with href attribute values that correspond to the AREA elements in the given usemap.

• Allow the author to create associated text links for each active area in the image map.

Fonts and Text Presentation

When designing web pages, content developers must separate structural presentation from content presentation.

• Header elements ( - ) are used to structurally identify new sections but NOT to achieve presentation effects.

• Style tags are to be used for presentation effects.

▪ Larger font (font-size: 2em)

▪ Bold

▪ Italic

• Quotations should be denoted with the proper tags

▪ Short quotations (one line or less)

▪ Long quotations (multiple lines)

▪ The tag should NEVER be used for indentation (use Style Sheets instead)

Font face and size will be used consistently for headings, labels, and text throughout the application. Default face, size 1em font will be used for labels and text. Error messages will be bold. Labels and field text are not bold.

In general, screen type sizes on the Windows platform appear about two points larger than the equivalent Macintosh versions. We will keep this dynamic in mind and make adjustments to text if it appears that it would significantly impact the readability of the page across platforms. At the same time, using default size will present no barrier. Ultimately, users can change the font size through their browser settings.

All the font sizes and styles must be kept in Style Sheets.

Coloring Schemes and Backgrounds

A consistent color scheme will be used throughout the application background, text, list tables and links. Ensure that all information conveyed with color is also available without color, for example from context or markup, also make sure that foreground and background color combinations provide sufficient contrast when viewed by someone having color deficits or when viewed on a black and white screen. If color is used to convey meaning, make sure the information is represented in another way. Use the CSS to determine the background color and the foreground color to the greatest extent possible. The actual color will be project specific. However the recommendation is:

• Background color is white inside a black frame.

• All static text, headers and labels, are default black.

• Error messages are default color red.

• Unvisited links are default color blue.

• Active links are default color red.

• Visited links are default color purple.

Graphics

Download time should be considered when including graphics on a page. Graphics files sizes should be limited to 30KB and contain ALT statements for text browsers. The graphics should be saved in GIF of JPG format. List the actual width and height information in the anchor reference in the graphic to improve the page formatting time.

Avoid the use of animated .gif images to convey meaning.

Graphics should be placed in only one directory called graphics.

Design for Device Independence

Device-independent access means that the user may interact with the user agent or document with a preferred input (or output) device -- mouse, keyboard or other. If, for example, a form control can only be activated with a mouse or other pointing device, someone who is using the page without sight, with voice input, or with a keyboard or who is using some other non-pointing input device will not be able to use the form.

Mandatory and Optional Fields

A mandatory field is the editable field on a page that that user is required to enter the information before being allowed to submit the form. Every mandatory field in the web page should be marked with an asterisks “*”. The “*” should be placed on the left hand side of the form element as shown below.

Question 1: * [pic]

Links

Descriptive titles to links make it easier to determine the purpose of a link for those users with interpretive devices. Link text should be meaningful enough to make sense when read out of context -- either on its own or as part of a sequence of links. Use the TITLE= attribute within tag to fully describe abbreviated links.

Links should be separated by more than a whitespace. Separating links into layout table data cells is the preferred way to address this accessibility issue.

Link colors should be the default standards. See 2.3.6 for more information about link colors.

Testing ADA Compliance

Understanding Bobby

Bobby is a tool that analyzes web page HTML code for its level of accessibility to people with disabilities. The Center for Applied Special Technology (CAST) offers the Bobby program as a free public service in order to further its mission to expand opportunities for people with disabilities through the innovative uses of computer technology. Bobby is a standalone Java application that can be downloaded from . In order to become ‘Bobby Approved’ the web page must meet all Priority 1 issues (Single A rating). A site must and contain only HTML tags that are compatible with Internet Explorer 5.0 or higher, Mozilla Firefox Version 1.0 or Higher and Google Chrome Version 5.0.375. or Higher. However, there are many tags and attributes that are added to enhance accessibility that are not supported in all browsers. These tags and attributes are OK to use as long as they “degrade gracefully” without changing the page appearance. Thus, in most cases, non-compliant browsers simply ignore the tags and attributes and there is no visible change the site. However, those that need the extra tags benefit greatly.

Test Process with Bobby

After installing the Bobby program to your local drive, enter the URL or disk location of the page(s) that you want Bobby to examine and click Submit. Bobby will display a report indicating any accessibility and browser compatibility errors found on the page(s). The Bobby report lists all Priority 1, 2 and 3 issues and browser compatibility errors along with the line of HTML code for the infraction. Once all the pages of your site receive a Bobby Approved rating, you are entitled to display a Bobby Approved icon from .

Understanding Wave

WAVE is a tool similar to Bobby that analyzes a web page HTML for accessibility, but takes a different approach. WAVE was developed by the Temple Institute on Disabilities and like Bobby is offered for public use as a tool to improve web page accessibility. Unlike Bobby, however WAVE was designed to be more qualitative and user-friendly for less experienced developers. WAVE also helps users address Priority 1, 2 and 3 issues by inserting user check graphics into the HTML page that being tested.

Test Process with Wave

WAVE is strictly an Internet based program and is not currently available for download. Pages to be tested in WAVE must reside on an Internet site with a valid URL outside any firewalls. To test a page, go to the WAVE site at:



and submit the URL to be tested. The submitted page will then be rendered back to your browser with helpful graphics inserted in areas that need accessibility consideration. Overall, WAVE is a program to help improve the accessibility of web pages, but there is no official WAVE certified graphic that you may display on your page. Compliance with WAVE is based on the honor system for those that truly wish to improve the accessibility of their pages.

Testing ASPs for Accessibility

The ASP file format is not valid to be tested in either Bobby or WAVE. In order to test and ASP page, the corresponding HTML output code must be generated. This resultant HTML may then be tested in Bobby or WAVE. This adds complexity, as the ASPs must be coded to produce Bobby and WAVE compliant code.

Relative Links

All links, whether for graphics or for browser redirection, will be relative links. A relative link means that the URL of the image or redirect is coded with respect for the current location. For example, if a link needs to point to default.asp in the same directory, the link is:

If default.aspx is in a nested images directory, the link is:

At no time include a full URL, as illustrated below, since it will not allow us to test the application outside of a production URL:

Usage of CSS1

Deprecated Tags

Cascading Style Sheets (Version 1) should be the only tool used to present page content. CSS2.1 adds a large number of useful presentation control attributes, however developers need to be cognizant that CSS elements render differently in various internet browsers. Many presentation tags have been deprecated in HTML 4.0 in lieu of style sheet attributes. The following elements have been deprecated or removed in HTML 4.0:

• APPLET, for Java applets: use OBJECT instead.

• BASEFONT, CENTER, FONT, STRIKE, U, for formatting: use style sheets for these formatting effects

• DIR, MENU, to define lists: use other list elements such as UL or OL, and use style sheets to refine the formatting

• ISINDEX, for simple form input: use an INPUT element within a FORM

• LISTING, PLAINTEXT, and XMP, for formatting fixed-width text: use the PRE element

Additional tags such as B, I and attributes such as color should also be removed in lieu of style sheet classes.

Note: Be aware that designing stylesheets to fail gracefully, required under W3C Checkpoint 6.1, may require you use deprecated elements, but do so with caution.

Style Sheets and Images

Proper use of style sheets to render recurring and background images can reduce download times and increase the accessibility of your page. The following guidelines control use of image files:

• ALL background images must also reside in style sheets.

• Recurring images such as buttons and tabs should be separated from the text displayed on them. The blank button or tab image (presentation) should reside in the style sheet background of a table cell while the text (content) resides in the HTML. This allows text to be scaled up or down and reduces the number of images a file page must import.

Form Elements

The graphical objects that are placed in a page to facilitate user interaction are HTML Form elements. Each form element has a built-in set of capabilities and display characteristics. Note that each browser and platform renders HTML form elements slightly different. For example, on Macintosh platforms, for example, buttons appear with a linear border and on Windows platforms, they don’t. The HTML form elements illustrated in this section are snapshots from a Windows platform. In this section, we will cover:

• Check Boxes

• Command Buttons

• List Boxes

• Multiple Selection List Boxes

• Radio Buttons

• Text Fields and Labels

• Hidden Form Fields

• Submit method

All input forms should explicitly associate labels with their controls.

Naming Standards

Tags and attributes will be written in all caps with attribute values in lower case and surrounded by “quotes”. We will name form elements using descriptive names in the Upper-case Lower-case convention. All form elements will have a prefix denoting their type of input according to the following list:

|Form Element |Name Prefix |

|Text Box |txt |

|Text Area |txa |

|Combobox |cbo |

|Checkbox |chk |

|Radio Button |opt |

|Control Button |cmd |

|Hidden Fields |hdn |

Example:

Individual Survey Page 1

Check Boxes

We will use check boxes for choosing more than one option, or for toggling a feature on or off. Guidelines for checkboxes are as follows:

• Check boxes will be labeled descriptively. We will pick a clear descriptive label that users will understand for each check box. For example, use Reverse Print Order, not Reverse.

• We will group and label check boxes. We will place check boxes together in a group and use an invisible table to preserve grouping. We will use a descriptive label for the entire group.

• We will align check boxes vertically and line up check boxes vertically rather than horizontally to make them easier to understand.

• We will limit check boxes to ten or fewer choices. If there are more choices or if layout space is of primary importance we will use a multiple select list box instead.

• We will choose one of the following ordering methods:

▪ By frequency—most frequently used options at the top

▪ By task—if there is a usual order in which parts of a task are performed

▪ By logic—if there is a logical order, for instance a list of dates

▪ By alphabet—if the labels match the way users think about the items.

Command Buttons

Command buttons are the primary way that users take action. We will use command buttons to convey to users the major actions of a particular box. Users will be able to glance at a dialog box and know what to do there and what to do next, based on the names and placement of the command buttons.

We will use command buttons when users are going to take immediate action that is frequent or critical. Command buttons act as reminders of what actions can and will be taken.

Guidelines for using buttons are as follows:

• Buttons will be grouped together. If more than one button, white space will group buttons together.

• The same terms will be used for the same actions throughout the application.

List Boxes

List boxes rather than option buttons will be used when there are a lot of options. With more than six option buttons, or when layout space is a premium, a single select list box will be used.

• If data is likely to change over time, a list box will be used. It is easier to change the choices that appear in a list box.

• We will choose a text label for the entire list box that describes the items inside the box. The label will be placed on the top of the list, left justified, followed by a colon.

• The default value in the box will be a blank tags. This will make the drop down box appear empty before an option is selected.

Radio Buttons

Radio buttons will be used when users need to pick one mutually exclusive choice from a list of options.

▪ Option buttons will be placed together in a group with an invisible table to contain the group and a descriptive label for the entire group.

▪ Option buttons will be lined up vertically to make them easier to understand.

▪ Option buttons will be limited to six or fewer choices

▪ We will choose one of the following ordering methods:

▪ By frequency—most frequently used options at the top

▪ By task—if there is a usual order in which parts of a task are performed

▪ By logic—if there is a logical order, for instance a list of dates

▪ By alphabet—if the labels match the way users think about the items.

• If users need to make yes/no or on/off choices, either radio buttons or drop downs may be used subject to user preference.

Text Fields and Labels

Text fields are used to display data to the user and allow the user to enter data.

• We will show display-only data without a box. If data are for display only and cannot be changed or added, we will not place a box around them.

• We will remove text input boxes from protected fields.

• We will use box length to signify approximate data length. Text boxes will be sized to indicate the approximate length of the field. Text boxes of similar length will be made the same length. We will always set the MAXLENGTH =xx value for text boxes.

• Text boxes will be left aligned on the screen to minimize the number of different margins. If a particular text box has a long label, we will use a different margin for that text box and limit the number of unique margins to two.

• We will label all text boxes and assign a descriptive label to every text box. We will capitalize the first letter of the initial word of a label.

• We will place labels for text boxes to the left of the box, not on top of text boxes.

• A colon will be used after text box labels to distinguish between the label and the data that follows. No colons will be used after group frame names or column headings.

Hidden Form Fields

The hidden form fields can be used to pass information to the web server. Secure content should not be present in hidden form fields.

Submit Method

Form contents can either be submitted using one of two methods, GET and POST. With the GET method, data is sent to the web server as part of the URL. With the POST method, the data is sent inside the HTTP header. We will be using the POST method, which prevents form contents from being displayed in the browser URL header. As a result, data is fetched by reading it using the Form collection in ASP.

DOs and DON’Ts

Cookies

The use of persistent cookies should be avoided unless absolutely essential to the application. For publicly accessible web pages/applications never use cookies.

Frames

Usage of frames in the application is strictly prohibited.

Others

All the tags elements in the HTML/ASP should be in CAPITALS.

Screen Resolution Considerations

The viewable area of most of the WWW clients is about 24 lines of text and 320 vertcal pixels. The page length should not be limited to no more than 2 or 3 640 X 480 screens and contain local navigation links both at the top and the bottom of the page. Every page should state the title, the application help/contact information and atleast one link to the organization’s home page.

The application need to be programmed to display appropriately in monitors that have 640 X 480 pixels resolutions.

The "safe area" for Web page graphics is determined by two factors: the minimum screen size in common use today (640 by 480 pixels), and by the width of paper used to print web pages.

Most monitors used in academia and business are 13 to 15 inches (33 to 38 cm) in size, and these smaller monitors are often set to display a 640 x 480 pixel screen. Web page graphics that exceed the width dimension of these small monitors will inconvenience many of users because they will have to scroll both horizontally and vertically to see the full page layout. We will constrain pages to a width to avoid any horizontal scrolling.

Usage of JavaScript

A option should be provided for all scripts. When using this tag, alternate information provided should be equivalent in nature to any content located in the script. Pages should be usable when scripts, applets, or other programmatic objects are turned off or are not supported.

Usage of pop-up windows via JavaScript is prohibited unless there is code in place to perform the same functionality or achieve the same effect for those browsers that do not support JavaScript or have it turned off.

Any event handler that is used must be keyboard accessible as well as Internet Explorer, Mozilla Firefox and Google Chrome compliant. The onfocus and onblur event handlers are preferred at the field level since all form elements have these handlers. Additionally, the combination of onenter and onclick are preferred at the page level.

Multi Browser Capability

If all the standards and guidelines in this document are followed to create the web site/application, most of the browsers available today should not have a problem displaying the content of the web site/application.

However the application should be tested in 3 most popular browsers that are available, namely:

• Microsoft Internet Explorer (Version 5.0 or Higher)

• Mozilla Firefox (Version 1.0 or Higher)

• Google Chrome (Version 5.0.375. or Higher)

-----------------------

Revised 12/12/02

DHS Business and Technical Standards

Page 20 of 20

HTML Development Standards.doc

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download