Development of (+) accessible web sites

cesperanc.github.io/daws/

Agenda

Agenda (2)

Agenda (3)

Agenda (4)

Motivation

Accessibility definition

Accessibility
relates to the means and resources that enhance the skills of those who use them, reducing the effect of existing barriers.

Users with disabilities

Disability types

Accessibility as a tool

Field of action

Web pages

Web pages are usually built in three languages:

HTML

HTML tags

A HTML tag is formed with elements like a name (required), attributes (optional) and a value (optional)

Image with a representation of the following HTML: <label for="test">Test label:</label><input id="test" />

Formal structure of a Web page

A Web page is made by a document type specification, a header and a body.

<!DOCTYPE html> <html> <head> <title>Page title</title> </head> <body> Page content </body> </html>

Formal structure of a Web page (2)

Cascading Style Sheet (CSS)

Example with some CSS instructions

The following example present a set of CSS instructions which define the color red and a font-weight with the style bold, to all paragraphs in a HTML document.

p { color: red; font-weight: bold; }

JavaScript

Practical tips: Language definition

<html lang="pt-PT"><!-- Set the document language to Portuguese --> (...) <span lang="en">Web</span><!-- The word "Web" is in English-->

Page titles

Headings

<h1>Site name</h1> <h2 class="list-title">Main menu</h2><ul><li>...</li></ul> <div id="content"> <h1>Page title</h1> <p>Page content</p> </div>

Increase your font size

Size inheritance

Attention to the size inheritance!

body { font-size: 1.6em; /* ±16px */ } h1 { font-size: 2em; /* 1.6em*2em≅3.2em (32px, not 20px) */ }

Text spacing

The lack of space between lines can make it difficult to read long texts:

line-height: normal;

Result:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed metus justo, id sagittis neque. Donec neque quam, consequat sit amet tincidunt in, semper id est. Integer sed odio ac metus accumsan rutrum elementum et tortor. Proin suscipit condimentum feugiat. Vestibulum placerat, justo sit amet dapibus fringilla, nisi diam laoreet diam, in ullamcorper arcu neque id mi.

Text spacing (2)

Adequate spacing between lines facilitates the transition between lines when reading:

line-height: 1.4em;

Result:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed metus justo, id sagittis neque. Donec neque quam, consequat sit amet tincidunt in, semper id est. Integer sed odio ac metus accumsan rutrum elementum et tortor. Proin suscipit condimentum feugiat. Vestibulum placerat, justo sit amet dapibus fringilla, nisi diam laoreet diam, in ullamcorper arcu neque id mi.

Paragraph spacing

Paragraph spacing is also important:

p{ margin-bottom: 0; }

Result:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed metus justo, id sagittis neque. Donec neque quam, consequat sit amet tincidunt in, semper id est.

Integer sed odio ac metus accumsan rutrum elementum et tortor. Proin suscipit condimentum feugiat. Vestibulum placerat, justo sit amet dapibus fringilla, nisi diam laoreet diam, in ullamcorper arcu neque id mi.

Paragraph spacing (2)

Spacing promotes paragraph isolation

p{ margin-bottom: 0.5em; }

Result:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed metus justo, id sagittis neque. Donec neque quam, consequat sit amet tincidunt in, semper id est.

Integer sed odio ac metus accumsan rutrum elementum et tortor. Proin suscipit condimentum feugiat. Vestibulum placerat, justo sit amet dapibus fringilla, nisi diam laoreet diam, in ullamcorper arcu neque id mi.

Text alignment

ARIA landmark roles

Alternative navigation methods

Alternative navigation methods (2)

Alternative navigation methods (3)

Tables

Formal structure of tables

<table> <caption>Table 1: Student evaluations by course</caption> (...) </table>
2 The usage of the summary attribute is now deprecated in HTML 5; the table description should now be done by using the caption or using a tag figure which wraps and describes the table.

Formal structure of tables (2)

<table> <caption>Table 1: Student evaluations by course</caption> <thead><!-- Header cells (...) --></thead> <tfoot><!-- Footer cells (optional) (...) --></tfoot> <tbody><!-- Content cells (...) --></tbody> </table>

Sample code of a table

<table> <caption>Table 1: Student evaluations by course (from 0 to 20)</caption> <thead> <tr> <th scope="col"><span title="Student ID">Student</span></th> <th scope="col"><span title="Course: Service Quality over a Network">SQN</span></th> <th scope="col"><span title="Course: Computation in Distributed Environments">CDE</span></th> </tr> </thead> <tbody> <tr> <th scope="row">2120915</th> <td>19</td> <td>17</td> </tr> <tr> <th scope="row">2120917</th> <td>18</td> <td>18</td> </tr> </tbody> </table>

Result of the previous example

Table 1: Student evaluations by course (from 0 to 20)
Student SQN CDE
2120915 19 17
2120917 18 18

More about tables

Understand a complex table only by hearing can be something quite difficult, so the recommendation is to simplify tables wherever possible.

There are some more HTML instructions for building more complex tables that were not addressed in this presentation. If necessary these additional options should be explored to facilitate the interpretation of data in tables.

Images

Images (2)

Color contrast

Here's a shy text...

Labels

Grouping in forms

Size of interactive elements

Accessibility tools

PE & GD

Tests and validation

Some important standards

Questions?

References

References (2)

Source code