The goals of this topic are to give you the basic tools and information to construct and evaluate your course pages using the proper accessibility standards. Complying with the proper HTML structure may not mean that the code complies with accessibility standards or best practices. We will see examples of both properly and improperly formed HTML with respect to the accesibility standards.
Whenever an image is included within instructional materials, it should always include some accompanying information to help describe the image and it’s significance to a vision impaired user. When we talk about images in web design, we have many methods available to add accessibility. The foremost of these methods is to add alt tags to all images that we have included.
Alt tags are included as an attribute of the <img> tag. The alt attribute is read buy assistive technologies such as a screen reader but not printed to the computer screen. An alt tag attribute should include a description of the image it is attached to. When a screen reader comes to an image, regardless of it having an alt tag attribute, it will verbally say “Graphic” followed by the alt tag’s included description. If the alt tag is not included, the user will simply hear, “Graphic” with no explanation of what the graphic is. The description of the image can vary depending on its context.
Alt tags should be no longer than 125 characters (including whitespace), otherwise JAWS screen reader will subdivide the description. If your description is going to be longer than the 125 characters, you will need to use the Long Description attribute.
(Insert code in action)
Long Description (longdesc) allows authors to provide a longer description of an image that you can with the alt attribute by using a separate HTML page. Rather than inserting the description in the quotations provided after the longdesc attribute, you would put a URL in its place. The URL will point to a separate page that can accurately provide the description without length or content restriction.
(Insert code in action)
Tab indexing is a way of numbering links and controlling the way a keyboard will navigate to links on a page. This is done by adding the tab index attribute within the hyperlink's code. Elements that support the tabindex attribute are; link (a), area, buttons, input, object, select, and textarea.
<a href="" title="Resources">Resource Page</a>
Elements like CSS and scripts should exist separately from the HTML code itself.
All styling should be handled externally from the HTML by using CSS. The CSS code should also live externally in a separate .css file that the HTML simply includes within the head tags.
The JavaScript functions should live externally from the HTML in a .js file. Calls to the .js file and functions should be the only JavaScript code included within the HTML file itself.
When using JavaScript in a page, the Page and content should continue to be available, accessible, and functional when JavaScript is disabled. An example outside of navigation and linking to content in new windows would be to have the answer to a question hidden until the user initiates an action to reveal the answer such as clicking on a button. When JavaScript is disabled, you may loose the intended purpose however, the answer should reveal itself in the initial rendering of the page.
Tables can be used in a few different ways. One is to use them to structure your web page which is considered a layout table. Layout tables are discussed more in depth in Lesson 2: Structure and Style. Since we want to talk about the HTML aspect of tables we will cover data tables and the importance of utilizing all the proper elements HTML has to offer.
Properly formatting data tables will ensure that assistive technologies such as screen readers can access and navigate the tables as well as ensure that the user is receiving the best possible understanding of the information that the data table contains. A well-formatted table will include a few basic elements beyond the typical table row (tr) and table data (td) tags. Other tags often forgotten include <caption>, <thead>, <tbody>, <tfoot>, and <th>. A properly formatted table resembles the basic structure of an HTML page. Much like the <html> <head> </head> <body> </body> </html> scheme, a table has a <table> <thead> </thead> <tbody> </tbody> </table> scheme. To pass as a functional web page, the structure for the html elements, are mandatory. A table that does not have these elements exactly as described in the following sections are not mandatory to print the table out to the page. For a data table to be accessible however, these elements are very important.
All tables should include a <caption> tag that gives the table a title so that assistive technologies can properly identify and navigate among them. This becomes very important when a page contains multiple data table. Without the <caption> tag, a screen reader will identify the table with one long string of all the contents it holds. When a page contains multiple table, the user can navigate from one table to the next with a keyboard shortcut. Because of this, it is important to have a <caption> tag so that the user can hear the titles and chose the table relevant to what they are searching for.
Much like the alt attribute used for images, tables use a summary attribute within the opening <table> tag that should describe the information that the table contains. This description is meant to be a generalized overview of the contents and not a detailed report. The summary attribute will not visibly appear on the web page but screen readers will be able to access and read the descriptions to the user.
There are two different types of tables elements that are considered a head. There is the table head <thead> and a header cell <th>. The header cell tag, <th>, is used in place of the <td> tags when the contents of the cell are meant to define the data to follow in either a row or a column. If the header cell defines a column, the <th> tag should include the attribute scope=”col”. Likewise, if the header cell defines a row, the <th> tag should include the attribute scope=”row”. For headers that are long, you can use the “abbr” attribute for an abbreviation. For a heading that is Chiquita Bananas the abbreviation could appear as follows: <th abbr=”bananas”>Chiquita Bananas</th>
Often, the first row of a table will be made of headers for the columns and there are now row headers in the table. In this case, it is acceptable to omit the scope attribute from the <th> tag. Even if there are row headers included, if the first row of cells are all column headers, they should be contained within the table header tags <thead>, much like <head> is used for an html page structure. The row header cells will then still be contained outside the <thead> tags. The big difference between the table head tags and the head tags used for the html information is that anything within the <thead> tag will render on the screen, with the exception of the summary attribute.
The majority of the table data, including the row headers, will be contained within the <tbody> tags. The body tags are used to group the main data content together. The <tfoot> tag can be used to hold an additional row of the header cells and display them at the bottom of the table.
Course |
Section |
Time |
Location |
---|---|---|---|
Biology 331 |
001 |
1:15 M W F |
214 Willard |
Biology 412 |
003 |
1:45 T Th |
112 Willard |
Math 021 |
005 |
3:45 MWF |
008 Sparks |
English 015 |
001 |
8:15 MWF |
012 Burrows |
History 100 |
002 |
11:30 MWF |
035 Thomas |
If it is possible, you should avoid including empty cells within your tables. Sometimes empty cells are used to separate headers from the table data but screen readers will voice the word “blank” when they come to an instance of an empty cell. If a table is a collection of data where some information is either not provided or unknown, then the empty cell is useful in showing missing data and a screen reader will convey that by voicing the word “blank”.
Course |
Course Number |
Section |
Time |
Location |
---|---|---|---|---|
Biology |
331 |
001 |
1:15 M W F |
214 Willard |
412 |
003 |
1:45 T Th |
112 Willard |
|
Math |
021 |
005 |
3:45 MWF |
008 Sparks |
English |
015 |
001 |
012 Burrows |
|
History |
100 |
002 |
11:30 MWF |
035 Thomas |
Add "Hear it read"
Lists are a great way to organize short, key points and data. Lists should not be used for large amounts of information that is in a paragraph form. If you are going to use a list, it should make sense for the content to be in a list form. Lists are best used for short and quick information. The type of lists should make sense for the information you are presenting. If it is a list of steps you need to take, an ordered list makes sense. If you have a list of ingredients in a recipe, then an unordered list would make sense. Lists can also be good when used for giving key terms and their definitions at the start or the end of a lesson. If you use a list format for key terms and definitions, be sure to use a Definition List style markup.
Example:
Example Code:
You can use one of two formats.
1. If you are going to use an in-line link, make the link descriptive to what you are linking to.
Example: For more information, you can visit the Penn State Home page.
In this example the link is named in a meaningful way to tell you where the link is taking you but also flows well within the sentence.
2. You can list the link outside of the sentence itself.
Example: For more information, you can visit the Penn State home page. Penn State Home
In this case, you also want to make the link name something meaningful to where the link takes you, not just the URL. The difference here is that the link name itself is not constrained to making the sentence flow well.
Example: More information on Penn State's Admissions statistics can be found at the following link: Admissions Statistics for Penn State
In this case, we lead with "Admissions Statistics" in the link name due to the way users of assistive technology search for links. If they read that sentence and know that they want to find enrollment statistics, and they are already on a Penn State web page, a larger percentage of uses just assume the Penn State involvement in the statistics, therefor they will use the links shortcut key and press the first letter of the expected link name, which in this case would be A for Admissions statistics. If we lead the link name with Penn State, they would not be able to get to the link quickly and would have to listen through all links until they heard the link that states enrollment statistics.
In all cases, you will want to be sure to include the title attribute for the link (title="Penn State Home"). This will in most cases match the link name shown if that name properly states what the link points to.