Professional Documents
Culture Documents
Lecture 10
Lecture 10
📅 26/10/2021
📚 DATA1200
© CC BY-NC 4.0
g
41 8
42 9
10
43
Previously on Lecture 9…
Do you
remember…?
What is the difference between FlexBox and
Grid layout?
Flex: single dimension. Grid: 2 dimension
What CSS properties are used to place grid lines?
grid-template-columns, grid-template-rows, (grid-template)
What CSS properties can be used to add gaps between columns and rows?
grid-column-gap, grid-row-gap and grid-gap.
How can you attach grid elements in the Grid container if you need to
specify the 4 boarders of the CSS box?
grid-row-start, grid-row-end, grid-column-start and grid-column-end
(grid-column and grid-row)
BLOCK LEVEL
Block, for sections in a webpage Lorem ipsum dolor sit amet, consectetur adipiscing elit.
•
Nullam sodales pretium ipsum. Etiam ut enim augue.
Inline, for text Etiam mi tortor, pulvinar at dictum faucibus, mollis eget
•
nunc. Morbi justo velit, rutrum vel placerat in, adipiscing
Table, for two-dimensional table data vitae sapien.
• Flex, to design exible responsive Lorem ipsum dolor sit amet, consectetur adipiscing elit.
layout structure without using oat or Nullam sodales pretium ipsum. Etiam ut enim augue.
Etiam mi tortor, pulvinar at dictum faucibus, mollis eget
INLINE
• Grid, it o ers a grid-based layout
system, with rows and columns Suspendisse potenti. Duis in erat
neque. Pellentesque habitant morbi tristique senectus et
without having to use oats and netus et malesuada fames ac turpis egestas.
ff
ff
i
fl
fl
fl
Grid Layout
• Grid layout is a generalised layout system
(2 dimensions).
• rows
• columns
• Grid allows pieces of the design:
• to be laid out independently of
their document source order
• to overlap pieces of the layout
By de ning the
placement of one or
more grid lines, you
implicitly create the
rest of the grid’s
components
fi
GRID PROPERTIES
Properties for the Grid Container Properties for the Grid Item
• display • grid-column-start
• grid-template-columns place
Create
• grid-template-rows • grid-column-end elements
grids
• grid-template-areas • grid-row-start
• grid-template • grid-row-end
• grid-column-gap • grid-column
• grid-row-gap • grid-row
• grid-gap • grid-area
• justify-items
• align-items • justify-self override
Style grids • place-items • align-self parent
• justify-content • place-self styles
grid-template-areas
Used to de ne template areas
https://css-tricks.com/snippets/css/a-guide-to- exbox/
g
fl
grid-template-areas
By MDN docs
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas
ff
Introduction to CSS Grid Layout
By Firefox devtools
https://mozilladevelopers.github.io/playground/css-grid/08-template-areas/
grid-template-areas
A codepen example…
grid-template-areas
A codepen example…
• Solution here
https://codepen.io/carlosvicient/pen/zYdZvxL
Background
Literature
Just some books…
Oh! I am lost!
Too many terms related to this topic…
• Universal design
• Inclusive design
• Accessibility
• Web accessibility
• WCAG
• WAI
• etc.
fi
fi
Universal design
Also referred as UD…
– There is no typical,
average, normal
user.
22
Image from: From the Interaction Design Foundation. © Center for Universal Design, NC State, 2011. All rights reserved.
Inclusive design
What is it?
• Design methodology that enables and draws on the full range of human
diversity
• Inclusive design means making your product available to as many users as
possible (like UD, right?)
• Focuses on the process of diversity. This is:
• Is about engaging authentically with the diverse people and, therefore,
• it may involve di erent solutions for di erent groups of people
(edge-cases) - One size ts one
ff
fi
ff
UD vs Inclusive design
So what?
Inclusive design is
Universal design is one-size- its-all.
one-size- its-one.
f
f
Accessibility
What is it?
ff
Disabilities and
impairments
Types of Disabilities
Motor impairments
28
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
1- Visual Impairments
Low Vision
People with low vision may use those tools or:
- Screen magnification software
- External (larger) displays
- Difficult to magnify graphical text without distortion
Color Blindness
– Inability to perceive differences between some of the colors. 0.5% 8%
- Green - Brown
- Blue - Purple
- Green - Blue
- Light green - Yellow
- Blue - Grey
- Green - Grey original photo deuteranopia protanopia tritanopia monochromacy
- Green - Black
– Text, images and page layouts can be resized without losing information.
– Text and images have sufficient contrast between foreground and background color.
– Hard of hearing
- Some loss of hearing function but still able to use hearing for communication.
- Often requires amplification.
Captions or transcripts
– Media players provide options to adjust caption text size and colors.
3- Motor Impairments
– Inability to use a mouse, slow response time, limited motor control.
- Cerebral palsy, neural-tube defects, muscular dystrophy and arthritis
42
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
4- Cognitive Impairments
– Learning disabilities, distractibility, inability to focus on large amounts of information.
– Cognitive issues:
- Memory
- Attention
- Problem-solving
- Text processing
- Math processing
- Visual processing
43
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
– Simple text.
44
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
45
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
Web accessibility
International Guidelines
– Web accessibility guidelines for Government websites in place since 1999
- visual
- auditory
- physical
- speech
- cognitive
- language
- learning
- neurological disabilities
- older individuals
- users in general
Principles of WCAG
Level AA
– The middle level of conformance, satisfying both Level A and Level AA criteria
Level AAA
– The highest level of conformance, satisfying Level A, Level AA, and Level AAA criteria
– Websites that do not at least meet level A are impossible for people with disabilities to
use.
W3C explains, “It is not recommended that Level AAA conformance be required as a
general policy for entire sites because it is not possible to satisfy all Level AAA Success
Criteria for some content.”
WCAG at a Glance
1.1 Text Alternatives: Provide text alternatives for any non-text content.
1.2 Time-based media: Provide alternatives for time-based media.
1.3 Adaptable: Create content they can be presented in different ways.
1.4 Make It Easier: Ease of use to see and read your content including separating foreground and background.
2.1 Keyboard Accessible: Make off I'm sure nobody available from a keyboard.
2.2 Enough Time: Provide users enough time to read and use content.
2.3 Seizures: Do not designed content in a way that is known to cause seizures.
2.4 Navigable: Provide ways to help users navigate, find content, and determine where they are.
3.1 Readable: Make text content readable and understandable.
3.2 Predictable: Make web pages appear and operate in predictable ways.
3.3 Input Assistance: Help users avoid and correct mistakes.
4.1 Compatible: Maximize compatibility with current and future user agent including assistive technologies.
60
https://www.w3.org/TR/WCAG/
https://www.w3.org/WAI/policies/norway/
Now Digdir,
not Di
https://www.digdir.no/digdir/velkommen-til-digitaliseringsdirektoratet/860
f
Proper code - Some
examples
Examples
Best practices you want to follow…
https://animate.style/
In HTML, there are some semantic elements that can be used to define different
parts of a web page:
Screen Readers
Things screen readers can do:
- Read all text visible on a page
- Read some tags that a sighted user will not be able to see (such as alt tags)
- List all headers and links
So, how can we do? - Perceive. Whether content is accurately displayed to a user
- Navigate. Whether a user can effectively move through that content
- Interact. Whether a user can freely engage with that content
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
Used to identify groups or a list of links which are intended to be used for navigation
Typically, the “footer” - containing information such as copyrights and policy documents
https://www.w3schools.com/tags/ref_language_codes.asp
<h1>This i s a heading</h1>
<p>This i s a paragraph.</p>
</body
</html>
>
>
>
>
>
>
Navigation
–The headings taken out of context should logically represent the page content for
screen readers and users who choose this option as a way to scan the page.
Styling Headers
An HTML heading tag, followed by a paragraph tag
2) 3)
Examples;
Forms
Tabindex in forms
<div tabindex="1">First name</div>
<div tabindex=”2">Last name</div>
<div tabindex=”3">Date of Birth</div>
Labels in forms
Forms - Errors
Erroring out vocally
Tables
Scoping Tables Table with summary and caption
Skipping a table
Flash
Text Cues in Flash Alternative page
Access Keys
Adding an access key to a page A main menu with access keys
Keyboard-only navigation
The most common method of keyboard-only navigation relies on the Tab key.
A picture of a button and then that same button with keyboard focus style applied.
0 value tabindex="0" It allows elements besides links and form elements to receive keyboard focus.
One <div> tag is ignored, while the other is added to the order as it
has the tabindex attribute added to it.
1 or greater value tabindex="1" It defines an explicit tab or keyboard navigation order. This must
always be avoided.
– 1 value tabindex="-1" It allows things besides links and form elements to receive
"programmatic" focus, meaning focus can be set to the element
through scripting.
Focus styles
107
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
<a href="https://webaim.org/" accesskey="w">WebAIM.org</a>
Provide shortcuts <form action="submit.htm" method="post">
<label for="name">Name</label>
<input type="text" id="name" accesskey="n">
<input type="submit"
id="submitform" accesskey="s" value="Submit">
</form>
Autofill
Forms - tabindex
TABINDEX TABINDEX and radio buttons
<track> element
<video> The “parent” element that wraps the other tags. It tells the page that it will be displaying a video.
This tag holds the path to the actual video file that the page will display. A video can have
multiple sources to account for different video formats, because some browsers will only display
<source>
videos with a certain format.
The tag we’re most interested in. This is what allows us to add our own subtitles and captions.
<track>
121
Yavuz Inal, IDG2012 - Web Accessibility, Usability and Ethics
WebVTT files
– It stands for Web Video Text Tracks format.
– The files that contain the actual caption data are simple text files (TextEdit or Notepad).
WebVTT validator
https://quuz.org/webvtt/
Youtube, Vimeo, and Netflix all support both .srt and .vtt
The same caption as the previous example but styled with red text and
a white background
A diagram showing how the position A visual representation of captions positioned in different
and line attributes affect the positioning places using the position attribute
of captions
Align
It can be
- start (left)
- center (middle)
- end (right)
Size
– It dictates how much of the screen our
captions take up.
– It’s specified as a percentage (0% - 100%).
Use design…
Part
Use design…
Part
Use design
Part
https://media.nngroup.com/media/articles/attachments/Heuristic_Summary1-compressed.pdf
https://www.nngroup.com/articles/ten-usability-heuristics/
I
I
I
• Design your web pages and web sites with the Web Content Accessibility Guidelines in
mind (WCAG 2.1)
• Design to comply with Level AA
• Use automatic tools to assess your accessibility but remember that some tasks require
manual inspection
• AChecker Web Accessibility Checker: https://achecker.achecks.ca/checker/index.php
• WAVE Web Accessibility Evaluation Tool: https://wave.webaim.org/
• Use browser extensions to help you when developing:
• Example: Web Developer O ered by: chrispederick.com https://
chrome.google.com/webstore/detail/web-developer/
bfbameneiokkgbdmiekhjnmfkcnldhhm/related
I
ff
fl
fi
fi
fi
That’s all
Now focus on the final project…
• That’s all
• You can still contact me during
the semester (OsloMet account)
• NTNU contact information next
slide
• Don't hesitate to say
hello if we stumble
across!
• Good luck! 😀
📇
Contact
Name, rank and role
information
Dr. Carlos Vicient-Monllaó,
Associate Professo
Study Program Coordinator —
Bachelor in Web Development / One-Year study program in Web Design
📱
Virtual contact information
@Carlos Vicient-Monllaó on MS Teams
carlos.vicient@ntnu.no