Semantic HTML and a11y Flashcards Preview

TL2 - Intro to HTML > Semantic HTML and a11y > Flashcards

Flashcards in Semantic HTML and a11y Deck (32):
1

Practice Resource: Semantic HTML

https://learn.shayhowe.com/html-css/getting-to-know-html/

2

Resource: HTML Dog : Tags, Attributes and Elements

http://www.htmldog.com/guides/html/beginner/tags/

3

Resource: Mark Pilgrim's Dive into HTML

http://diveinto.html5doctor.com/

4

Mozilla's Developer Network (MDN)

https://developer.mozilla.org/en/docs/Web/HTML/Element

5

What is Semantic HTML?

The practice of choosing an HTML element to wrap content that most clearly aligns with the meaning of your content.

6

What are some elements that can strengthen the Semantic HTML on your document?

When you're writing HTML, strive to use elements that communicate the meaning of your document's structure

To name a few:

,, , , , , and others when appropriate.

7

Resource: Mozilla's HTML Element Reference

https://developer.mozilla.org/en-US/docs/Web/HTML/Element

8

What is A11Y or a11y?

It stands for "accessibility" and its a principle that every programmer should be thinking of when building code.
It is the practice of making web pages accessible to both able-bodied and disabled users.

9

Why is A11y so important? (1/2)

The web has user of every stripe, including many with disabilities. The web should be made with everyone's usability in mind.

10

Why is A11y so important (2/2)

Web crawlers index content on the pages you code to make it appear in searches.. The better the semantic html code, the better the SEO results.

11

Define a mouse user:

usually not visually or dextrously impaired. Uses the mouse or touchpad for most web navigation

12

Define a keyboard user:

Primarily uses the keyboard or keyboard and mouse combo, like a power user.

13

Define a screen reader user:

Are visually impaired people who have websites read to them by a screen reader, which is an assistive technology that reads the contents of a web page out loud.
Screen reader users may not be blind but still benefit from audio to help them process the websites they use.

14

Resource: Valid HTML Language Codes

https://www.w3schools.com/tags/ref_language_codes.asp

15

How can the lang attribute be used? (1/2)

It can be used in the opening tag .
This will tell the whole page to orate in whatever language defined. THIS SHOULD BE DONE EACH AND EVERY TIME YOU CODE.

ex:

16

How can the lang attribute be used? (2/2)

It can also be used on a specific element on an html document.
For example, if a paragraph is written in spanish,
You want an orator on the page with spanish dialect and way of speaking, not english

Yo soy Maria. Qual es tu nombre?



17

What is a "role" attribute?

Roles tell a browser, "This is the kind of job my content is supposed to do." They make it easier for screen reader users to understand what is on the page and how to use it

18

Are there lots of types of "roles"?

Yes, there are. Here is a resource:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques

19

Resource: Mozilla ARIA and Roles

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques

20

What does ARIA stand for?

Accessible Rich Internet Applications

21

What is ARIA used for?

Screen readers use ARIA to help people who use assistive technologies understand and use web sites.

22

What element is the "banner" role used for?

It is used with the element
It is an HTML5 section role

Example: Content here

23

What is the proper codeout for a role?

The role should always be surrounded by quotation marks.

Ex: Menu

24

What element is the "navigation" role used for?

It is used with the element
It is an HTML5 section role

Example: Quicklinks

25

What element is the "main" role used for?:

It is used with the . element
It is an HTML5 section role

Example: Content here

26

What element is the "contentinfo" role used for?

It is used with the . element
It is an HTML5 section role

Example: Phone: 555.12.12

27

What element is the "region" role used for?

It is used with the . element
It is an HTML5 section role

Example: Content here

28

What's the point or importance of using roles in my HTML coding?

Its important because roles give implicit instructions in the HTML document .
There is no mistaking/confusing the purpose of an element if there is role attached to it.
This makes code easier to read and render, thus making the best possibility for users who may need to use assistive technology.

29

Roles can be defined as ARIA landmarks. Why?

Through their roles, these elements serve as ARIA landmarks for visually impaired people.
Think of ARIA landmarks as a list of shortcuts.
Just as you can quickly glance around to find a part of a page you want, a screen reader user can quickly cycle through landmarks to get where they want to go.

30

But isnt the use of roles redundant since the element defines what its supposed to be anyway.

Yes it is redundant, but is good redundancy.

Also, older browsers don't know the implicit roles of HTML5 elements like , , , and so we have to help them out by explicitly setting redundant roles using the role attribute.

31

Can I have more than one "banner" role per HTML document?

NO, you should not.

Since you should not have more than one element per page, it follows reason that you should not have more than one "banner" role per page since
that role is explicitly used for the element.

32

For the best code always do the following:


-- use structured, semantic HTML
-- set the lang attribute on the opening HTML tag
-- set the role attribute where appropriate, especially for sectioning elements like:
for site-wide headers
for navigation elements
for main elements
for your site's footer