HTML Accessibility Flashcards

(29 cards)

1
Q

Why make a web site accessible?

A

The internet is for everyone, but it won’t be unless we make it so. -Vint Cerf

A website should convey information to all users. There are millions of users with disabilities and access to information is a human right.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are semantic elements?

A

Semantic elements have implied meaning

i.e. form, table, and article
div and span are NOT semantic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are two semantic tags that should be used whenever possible? What do they mean to the user.

A

1) the ‘button’ tag: it is implied that it will always perform an action for the user.
2) the ‘a’ tag: it is always implied to be a hyperlink, to always send the user to another page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What semantic elements define different sections of the page?

What are they referred to as?

A

Answer:
header, nav, main, aside, article, section, footer

They are ‘landmarks’.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why use ‘button’ over a ‘div’?

A

Answer: button elements are focusable, clickable, and screen readers identify buttons.

A keyboard only user can tab to a button, they cannot tab to a div.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

If something could be an ‘a’ tag and a ‘button’ tag, which should it be?

A

Answer: any element that navigates the user to another view/page should be an ‘a’ tag.

If there is a drop down menu of hyperlinks a button should be used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

If a semantic element cannot be used, how do you make an element accessible?

A

Answer:

With the attribute role, a name in the content, and an aria value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Is color contrast important?

What is a preferred level of color contrast?

How does the contrast scale work?

A

Answer: for the visually impaired color contrast is very important.

A level of 7:1 is preferred

White font on white is a 1:1, and black font in white is 21:1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Should different states have good contrast?

A

Yes, hover, focus, active, unvisited, visited, and deactivated all need a contrast of at least 3.5:1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Should the underlines below hyperlinks be removed?

A

NO, the colorblind rely on the underlines to see hyperlinks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can you improve the readability of hyperlinks?

A

With CSS properties:
text-underline-offset,
text-decoration-color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a decorative image?

How do we define a decorative image?

A

Decorative images do not add understanding or functionality to the page. We can define this with an empty alt=”” attribute

<img></img>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you hide decorative, non-‘img’ icons from screen readers?

A

With role=”img” and aria-hidden=”true”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can we add meaning to meaningful images?

A

With the alt=”” attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How should the meaning of an interactive home icon be defined?

A

(Describe the function of the icon)
img src=”myBusinessLogo.jpg”
alt=”Home Page of MyBusiness”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a good way to style hyperlink states?

A

With CSS properties:
outline-color
outline-offset

17
Q

Are headings tags good for accessibilty?

A

Yes! Headings (h1… h6) provide an outline for the page.

18
Q

How can we maintain the focus state on all hardware?

Why is this important?

A

Never use CSS property outline: 0; outline is used to focus the element.

The focus state is used by many people with disabilities to navigate a page.

19
Q

What are skip links?

A

These are defined elements to focus on with screen readers and ‘tab’

Skip Links greatly aid users with disabilities.

20
Q

How do you create a skip link?

A

With a hyperlink to an element id

header
a href=”#main” class=”skip >skip to main content<
/header

main id=”main”

21
Q

How can we set up HTML to work with screen readers?

A

Answer: use the lang=”” attribute

html lang=”en”

22
Q

How should skip links be styled with CSS?

A
.skip {
  position: absolute;
  top: auto;
  left: -10000px;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
.skip:focus {
  position: static;
  width: auto;
  height: auto;
}
23
Q

How do you properly use a label for accessibility?

A

When an element, such as ‘select’, needs a descriptor set label for=”” equal to the select element’s id.
The screen reader can read the content of that label for the select element.

24
Q

When should you use aria-required=”true”?

A

When a label is set to mandatory with an *

Use the attribute aria-required on the element the label is referring to

25
How can you label a visual label for screen readers? (Sans label element)
On the input element add an aria-label attribute. Input placeholder="enter search term" aria-label="enter search term"
26
When do you use fieldset and legend elements for accessibility?
When there are groups of form controls together that all need labels.
27
What elements use the autocomplete attribute?
Elements: | input, textarea, select, and form
28
Page zooming is good for accessibility. What principles should be followed for page zooming?
1) avoid horizontal scrolling 2) all content & functionality is maintained 3) avoid text images 4) allow space for key content
29
What is an accessible error message?
An error message that is: >written in text (color change and '!' icons help but are not enough) >adjacent to the element that failed >associated to the failed element >moves focus to the form control that failed