为了确保每个人都能访问网站和web应用程序, Cal State LA web designers, developers, 内容创作者必须遵循最新的网页可访问性指南.
Forms
Forms are commonly used to provide user interaction on websites and in web applications. For an online form to be accessible, 每个表单字段都必须有一个标识其用途的描述性标签. The label should be placed adjacent to its respective field and must be associated with the field.
You can improve the accessibility of your form by following these best practices.
- 就如何填写表格提供清晰的说明.
- Clearly indicate required fields.
- Place form fields in a logical order.
- 对相关的表单字段进行分组并适当地标记它们.
- 确保表单字段可以使用键盘导航.
- 确保错误被清楚地传达并且易于识别.
Drupal Websites
如果你的网页是托管在大学的Drupal网络平台(www.drupal.org)上.bayamonworkingtools.net),您可以通过使用Webform内容类型轻松创建可访问的表单. When you add a new form field, the label you enter for the field is automatically associated with the corresponding field. 您还可以使用拖放功能轻松地对字段进行分组和排序. 有关如何在Drupal中创建表单的说明,请访问 Creating Webforms page.
Non-Drupal Websites
如果你的网页托管在大学的网络服务器(web.bayamonworkingtools.net) or by a third-party, 使用正确的HTML标记将标签与其对应的字段关联起来. 如果您使用JavaScript来操作表单数据或进行表单验证, 确保表单仍然可以使用键盘进行导航. For more information, visit W3C's Forms Concepts page and WebAIM's Creating Accessible Forms page.
Frames
Frames
框架用于将网页分成不同的部分, with each section being its own window. If possible, avoid using frames because they create usability and accessibility issues. If you must use frames, ensure that each frame has a meaningful title which gives a clear indication of the content within that frame. Also, include a
Iframes
Inline frames (iframes) are used to embed content from one webpage into another (e.g.比如YouTube上的视频或社交媒体小工具). 如果您在页面上合并iframe,请确保它有一个有意义的标题. Also, provide alternative content by including a text description between the iframe start and end tags.
For more information, visit WebAIM创建可访问的框架和iframe page.
Heading
Headings help users understand what information is contained on a webpage and how that information is organized. Headings also allow screen-reader and assistive technology users to skim the structure of a page and navigate to or skip over sections.
在设计页面结构时,请遵循以下最佳实践.
- 使用标题来表示页面的结构,而不是视觉效果.
- 对所有可视标题应用标题标记(h1-h6). 不格式化文本,使其看起来像一个标题.
- 只使用一个主标题(h1)作为页面标题.
- Order headings properly. h1的副标题为h2s, h2s的副标题为h3s,以此类推.
- Make headings short and descriptive so users can easily find the information they are looking for.
- 确保所有的标题都有相关的内容.e., no empty headings).
Drupal Websites
如果你的网页是托管在大学的Drupal网络平台(www.drupal.org)上.bayamonworkingtools.net),您可以应用标题样式(标题2,标题3等).),使用所见即所得工具栏上的格式按钮. In Drupal, the page title is marked up as Heading 1, so the first level of subheadings within the page content should be marked up as Heading 2.
Non-Drupal Websites
如果你的网页托管在大学的网络服务器(web.bayamonworkingtools.net) or by a third-party, use correct HTML markup to style headings (h1, h2, h3, etc.). For more information, visit W3C's Headings page.
Images
图像可以增强内容或增加网页的视觉趣味, 但有视力障碍的人无法进入. To be accessible, all images are required to have an equivalent alternative text (alt text). 它由屏幕阅读器读取,而不是图像, 允许访问图像的内容和功能. The most appropriate alt text for an image depends on the purpose of the image within the context of the webpage.
- If an image conveys simple information, Alt文本应该传达与图像相同的基本信息.
- If an image conveys complex information (e.g., a chart or graph), it should include a short alt text and a long description that provides more detail about the image.
- 如果图像纯粹是装饰性的,则alt属性应该为空(alt=""). 这告诉屏幕阅读器完全忽略图像.
- 如果图像有标题或在相邻的文本中描述, the alt attribute should be empty (alt="") so that the information is not read twice by screen readers.
- 如果图像包含文本,则所有文本应包含相同的文本.
- 如果图片被链接,那么alt文本应该描述链接的目的地.
- If an image is used as a button, the alt text should describe the button's purpose.
For more information, visit WebAIM's Alternative Text page.
Drupal Websites
确保托管在大学Drupal网络平台上的网站(www.drupal.org).calstatela.Edu)满足可访问性要求,所有图像都需要Alt文本. 有关如何在Drupal中添加图像的说明,请访问 Adding Images page.
Non-Drupal Websites
如果你的网页托管在大学的网络服务器(web.bayamonworkingtools.net) or by a third-party, ensure that all images include an appropriate alt text. For more information, visit W3C's Images Concepts page and WebAIM's Accessible Images page.
Links
链接是网站最基本、最重要的元素之一. They are essential for website navigation and can be used to cross-reference related content. 因此,不可访问的链接是网站可能遇到的最大问题之一.
When Using Links
You can improve the usability and accessibility of your links by following these best practices.
- 使用断章取义时有意义的链接文本. Avoid using redundant or ambiguous link text such as "click here" or "read more".
- Keep link text concise. A long link is more likely to break across lines on a webpage, making it look like two links.
- Avoid using URLs as link text. If a URL is relatively short such as a site's homepage, it may be used as the link text.
- 不使用相同的文本链接到不同的目的地.
- 确保链接可以使用键盘导航.
- 对链接进行样式设计,使其区别于网页上其他类型的文本. 给链接加下划线是表示文本可点击的标准约定.
For more information, visit WebAIM's Links and Hypertext page.
Plug-ins
Plug-ins enable web browsers to display a particular file format (PDF, Word, Excel, PowerPoint, etc.). 当一个网页链接到一个需要插件来显示内容的文件时, 必须提供到可以下载插件的页面的链接.
Drupal Websites
如果你的网页是托管在大学的Drupal网络平台(www.drupal.org)上.bayamonworkingtools.net), this requirement is automatically met for common file types via the File Viewers link located in the website footer. 如果您链接到一个需要插件的文件,而该插件没有在列表中列出 File Viewers and Plug-ins 页面,您需要添加一个链接到可以下载插件的页面.
Non-Drupal Websites
如果你的网页托管在大学的网络服务器(web.bayamonworkingtools.net) or by a third-party, you can meet this requirement by adding a link to a page where the appropriate plug-in can be downloaded. 有关常用文件类型的插件列表,请访问 File Viewers and Plug-ins page.
Skip-Navigation
许多网站都有跨多个页面的冗余导航链接. 适用于屏幕阅读器用户和通过键盘导航的用户, these links can become burdensome if there is no way to efficiently skip past them. To improve the accessibility of your site, include a skip navigation link on each page to allow site visitors to skip over repetitive page elements and get to the main content.
Drupal Websites
如果你的网页是托管在大学的Drupal网络平台(www.drupal.org)上.bayamonworkingtools.net), this requirement is automatically met. Drupal中创建的每个页面都包含一个“跳到内容”链接.
Non-Drupal Websites
如果你的网页托管在大学的网络服务器(web.bayamonworkingtools.net) or by a third-party, you can meet this requirement by adding a link at the top of each page that goes directly to the main content. For more information, visit WebAIM's Skip Navigation Links page.
Tables
Tables should be used to present data; they should not be used to create a page layout. For a data table to be accessible, it needs to include column and/or row headers and markup that associates data cells to their respective headers.
Drupal Websites
如果你的网页是托管在大学的Drupal网络平台(www.drupal.org)上.bayamonworkingtools.net), you can easily create accessible tables. When you add a table to your page, make sure to specify column and/or row headers in the Table Properties dialog box. Based on your selection, Drupal will automatically add the appropriate markup to your table to associate data cells with their headers. 有关如何在Drupal中添加表的说明,请访问 Adding Tables page.
Non-Drupal Websites
如果你的网页托管在大学的网络服务器(web.bayamonworkingtools.net) or by a third-party, make sure to create accessible tables by using the appropriate HTML markup to associate data cells with their headers. For more information, visit W3C's Tables Concepts page and WebAIM's Creating Accessible Tables page.
Text
To be accessible, website text must have a high level of readability and legibility. Readability is the ease with which a reader can recognize words, sentences, and paragraphs. Legibility is the ease with which a reader can recognize individual characters in text.
您可以通过遵循这些最佳实践来提高文本的可访问性.
- Write clearly and concisely.
- Structure content with headings and lists.
- 使用真实的文本,而不是嵌入在图形中的文本.
- 在文本和背景之间提供足够的对比.
- Select simple, readable fonts.
- Avoid small font sizes.
- Use relative units for font size.
- Avoid fully-justified text.
- Avoid blinking or moving text.
- Limit the use of font variations such as bold, italics, and ALL CAPITAL LETTERS.
- 除非文本是链接,否则不要在文本中添加下划线.
- Identify any changes in language (e.g., English to Spanish).
Creating Accessible Web Content
Most web content can be made accessible by following the simple guidelines listed above. For a comprehensive list of web accessibility guidelines and how to meet them, visit WebAIM's WCAG 2.0 Checklist page and W3C's How to Meet WCAG 2.0 page.
Color
Use of Color
Color is an important aspect of web design. 然而,一些用户在感知颜色方面有困难. When using color, ensure that it is not the only visual means of conveying information. If you do use color to convey information (e.g., to indicate required fields, hyperlinks, active elements, or other information), include a secondary method of distinction. For example, 如果网页引导访问者按下绿色按钮寻求帮助, 它还应该包括按钮上的“帮助”字样. This way, a person who is colorblind can still identify that the button is for help.
Color Contrast
When using color, provide sufficient contrast between text and its background so that people who have visual impairments can read the content.
- 文本和背景之间的最小对比度应为4.5:1.
- Text that is larger (at least 18 points if not bold or 14 points if bold) can have a contrast ratio of 3:1.
- These requirements also apply to images of text if those images are intended to be understood as text.
- 装饰性且不传达任何信息的文本没有对比度要求.
Use the WebAIM Color Contrast Checker 要测试文本与其背景之间的对比度: