SlideShare a Scribd company logo
1 of 20
Download to read offline
Accessibility with CSS


    Lisa Seeman
Accessibility – not the “average user”
Getting your content to everyone:

   Disabilities
       Visual disabilities
       Hearing disabilities
       Physical disabilities
       Cognitive or neurological disabilities

   Other interoperability Scenarios

   AT
       Screen readers, brail readers, magnification, key pad etc
Our hero

W3C WAI - United approach so that all different player
 work together

   WCAG (Web Content Accessibility Guidelines)
   UAG (User Agent Accessibility Guidelines (UAAG)
   ATAG (Authoring tools accessibility guidelines)
   WAI-ARIA (Accessible Rich Internet Applications)
   Other specifications via PF
WCAG

   Principles – the idea
   Checkpoints – what
   Success criteria – more detailed what
   Techniques – how



   See WCAG techniques for CSS
WCAG 2.0
WCAG 2.0 Guidelines – not for the “average user”, using a flat screen,
  mouse …..

   1 Perceivable
       1.1 Provide text alternatives.
       1.2 Alternatives time-based media.
       1.3 Adaptable - without losing information or structure.
       1.4 Distinguishable (such as color contrast).
   2 Operable
       2.1 Keyboard accessible
       2.2 time to read and use content.
       2.3 seizures.
       2.4 navigatable,.
   3 Understandable
       3.1 readable.
       3.2 predictable.
       3.3 Help users
   4 Robust
Well formed CSS

A bit like separating form and content
   Text / function / structure in the mark up
   Presentation in CSS


Perceivable, adaptable, operable,
 understandable, robust

CSS Techniques - how to do it in CSS
 The good

 The bad
CSS is beautiful

   Chapter 1 introduction to accessibility
   1.2 Accessibility and CSS


       Key points                 Tools
      • Clear structure in      • :before for symbols
      mark up via heading       • Colors for heading
      levels                    levels
      • Easier to follow
Using CSS to control visual presentation
of text
Accessible relationships,
Resizable, accessible text

CSS can be used to control the visual presentation of text. This will
  allow users to modify, via the user agent, the visual characteristics
  of the text to meet their requirement. The text characteristics include
  aspects such as size, color, font family and relative placement.

Text within images has several accessibility problems, including the
  inability to:
 be scaled according to settings in the browser
 be displayed in colors specified by settings in the browser or rules in
  user-defined style sheets
 honor operating system settings, such as high contrast
Control visual presentation of text
>h1 class="overlap"><span class="upper">News</span><br />
>span class="byline">today</span></h1>

.overlap { line-height:0.2em; }
.upper { text-transform:uppercase; letter-spacing:1em; text-
   align:left;}
.byline { color:red; font-style:italic; font-weight:bold; padding-
   left:3em; }

---------
>p class="startletter">Once upon a time...</p>

startletter:first-letter { font-size:2em; color:#990000; vertical-
   align:middle; }
Resizable text

Specifying the size of text containers using em units

#nav_menu { width: 20em; height: 100em }

#nav_list { font-size: 100%; }
input.pick { font-size: 100%; width: 10em; }

Scaling form elements which contain text
       p, label, input { font-size: 1em; }

input.geomsize {width: 1.2em;height: 1.2em;} (IE only)
Stay on the page


Allows users to view content in such a way that
  line length can average 80 characters or less

#main_content {max-width: 70em}
Margin and padding

Using CSS margin and padding rules instead of
 spacer images for layout design (Non-text
 Content)

table {margin: .5em; border-collapse: collapse; }


And better knowledge processing
User interface

Using CSS to change the presentation of a user
  interface

Component when it receives focus -focus visible,
not reliant on color

#mainnav a:hover, #mainnav a:active, #mainnav
  a:focus {
 background-color: #DCFFFF;
 color:#000066;}
Hide and show

   Accessible scripts
       Class = visible / invisible..


   Hide a portion of the link text span
    Eg jump to main
    }height: 1px; width: 1px; position: absolute; overflow:
      hidden; top:10px; }
ARIA Accessible Rich Internet
Applications
   ARIA exposes what is going on in Applications to Assistive
     technology (adds semantics)

      With ARIA States and author-Settable Properties become explicit
       in internet applications
      State … Checked, pressed, value, selected
      ARIA states are used to track the state of each control or widget
       and expose it to the user device
      In scripts event toggles state and often class for the visual effect

<span class="checkbox" id="chbox1" role="checkbox" aria-checked="true"
   onkeydown="return checkBoxEvent(event);" onclick="return
   checkBoxEvent(event);" > Include decorative fruit basket </span>
   </div>
Bad: Inserting non-decorative content
Inserting non-decorative content
By using :before and :after pseudo-elements and the 'content' property in CSS

p.jim:before {content: "Jim: " } p.mary:before { content: "Mary: " }
q:before { content: open-quote } q:after { content: close-quote }

<p class="jim"> <q>Do you think he's going to make it?</q></p>
<p class="mary"> <q>It's not looking good.</q></p>

p.fact:before { content: "Fact: "; font-weight: bold; }
p.opinion:before { content: "Opinion: "; font-weight: bold; }

<p class="fact"> The defendant was at the scene of the crime when it occurred. </p>
<p class="opinion"> The defendant committed the crime. </p>

Inserting non-decorative content
Check pictures are decorative only - with no message or redundant message

NOT CSS as intended
Bad: Losing the mark up structure

   >p class=“heading1”>

   >img class=“button”>

CSS is presentation

Accessibility is interoperability
Bad: Changing the meaning of content by
positioning information out of the DOM

menu1 {                        .item1 {
  position: absolute;             position: absolute;
  top: 3em;                       top: 7em;
  left: 0em;                      left: 0em;
  margin: 0px;                    margin: 0px }
  color: red;
  background-color: white }    .item2 {
                                   position: absolute;
.menu2 {                           top: 8em;
   position: absolute;             left: 0em;
   top: 3em;                       margin: 0px }
   left: 10em;
   margin: 0px;
   color: red;
   background-color: white }
Make sure the DOM makes sense
When style sheets are applied, the data are displayed in two columns of "Products" and
   "Locations." When the style sheets are not applied, the text appears in a definition list
   which maintains the structure and reading order.

<div class="box">
 <dl>
  <dt class="menu1">Products</dt>
  <dd class="item1">Telephones</dd>
  <dd class="item2">Computers</dd>
  <dd class="item3">Portable MP3 Players</dd>
  <dt class="menu2">Locations</dt>
  <dd class="item4">Idaho</dd>
  <dd class="item5">Wisconsin</dd>
  </dt>
 </dl>
</div>

Mark up is content, CSS is the presentation
CSS is beautiful – When used for form,
not content
   Chapter 1 introduction to accessibility
   1.2 Accessibility and CSS


       Key points                 Tools
      • Clear structure in      • :before for symbols
      mark up via heading       • Colors for heading
      levels                    levels
      • Easier to follow

More Related Content

What's hot

DEFINE FRAME AND FRAME SET WITH A EXAMPLE
DEFINE FRAME AND FRAME SET WITH A EXAMPLEDEFINE FRAME AND FRAME SET WITH A EXAMPLE
DEFINE FRAME AND FRAME SET WITH A EXAMPLEVaibhav Sinha
 
M.florence dayana dream weaver
M.florence dayana   dream weaverM.florence dayana   dream weaver
M.florence dayana dream weaverDr.Florence Dayana
 
Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web DesignShawn Calvert
 

What's hot (7)

Html siva
Html sivaHtml siva
Html siva
 
Html session
Html sessionHtml session
Html session
 
Resume1-1
Resume1-1Resume1-1
Resume1-1
 
DEFINE FRAME AND FRAME SET WITH A EXAMPLE
DEFINE FRAME AND FRAME SET WITH A EXAMPLEDEFINE FRAME AND FRAME SET WITH A EXAMPLE
DEFINE FRAME AND FRAME SET WITH A EXAMPLE
 
M.florence dayana dream weaver
M.florence dayana   dream weaverM.florence dayana   dream weaver
M.florence dayana dream weaver
 
Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web Design
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 

Similar to Accessibility and css - Lisa Seeman

Css methods architecture
Css methods architectureCss methods architecture
Css methods architectureLasha Sumbadze
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
Style Your Site Part 1
Style Your Site Part 1Style Your Site Part 1
Style Your Site Part 1Ben MacNeill
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Hatem Mahmoud
 
Build a better UI component library with Styled System
Build a better UI component library with Styled SystemBuild a better UI component library with Styled System
Build a better UI component library with Styled SystemHsin-Hao Tang
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksAndolasoft Inc
 
Webpage style with CSS
Webpage style with CSSWebpage style with CSS
Webpage style with CSSHemant Patidar
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Wahyu Putra
 
Successfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience ManagerSuccessfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience ManagerPerficient, Inc.
 
CSS-3 Course Slide
CSS-3 Course SlideCSS-3 Course Slide
CSS-3 Course SlideBoneyGawande
 
Start your app the better way with Styled System
Start your app the better way with Styled SystemStart your app the better way with Styled System
Start your app the better way with Styled SystemHsin-Hao Tang
 

Similar to Accessibility and css - Lisa Seeman (20)

Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Sass Essentials
Sass EssentialsSass Essentials
Sass Essentials
 
Css methods architecture
Css methods architectureCss methods architecture
Css methods architecture
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
Style Your Site Part 1
Style Your Site Part 1Style Your Site Part 1
Style Your Site Part 1
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 
Build a better UI component library with Styled System
Build a better UI component library with Styled SystemBuild a better UI component library with Styled System
Build a better UI component library with Styled System
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
 
Webpage style with CSS
Webpage style with CSSWebpage style with CSS
Webpage style with CSS
 
Css
CssCss
Css
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3
 
SMACSS Workshop
SMACSS WorkshopSMACSS Workshop
SMACSS Workshop
 
An Introduction to CSS
An Introduction to CSSAn Introduction to CSS
An Introduction to CSS
 
Successfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience ManagerSuccessfully Implement Responsive Design Behavior with Adobe Experience Manager
Successfully Implement Responsive Design Behavior with Adobe Experience Manager
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
Material design
Material designMaterial design
Material design
 
CSS-3 Course Slide
CSS-3 Course SlideCSS-3 Course Slide
CSS-3 Course Slide
 
Hardcore CSS
Hardcore CSSHardcore CSS
Hardcore CSS
 
Start your app the better way with Styled System
Start your app the better way with Styled SystemStart your app the better way with Styled System
Start your app the better way with Styled System
 

More from Israeli Internet Association technology committee

יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידיםיחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידיםIsraeli Internet Association technology committee
 

More from Israeli Internet Association technology committee (20)

נגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשה
נגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשהנגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשה
נגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשה
 
ליאור שיאון - מפת מקלטים
ליאור שיאון - מפת מקלטיםליאור שיאון - מפת מקלטים
ליאור שיאון - מפת מקלטים
 
טל גלילי - אושאידי
טל גלילי - אושאידיטל גלילי - אושאידי
טל גלילי - אושאידי
 
אמרי באומר - האקתון חוסן לאומי
אמרי באומר - האקתון חוסן לאומיאמרי באומר - האקתון חוסן לאומי
אמרי באומר - האקתון חוסן לאומי
 
אורי סגל - מרחב מוגן
אורי סגל - מרחב מוגןאורי סגל - מרחב מוגן
אורי סגל - מרחב מוגן
 
אופיר בן אבי - ממשל זמין
אופיר בן אבי - ממשל זמיןאופיר בן אבי - ממשל זמין
אופיר בן אבי - ממשל זמין
 
יובל טיסונה - המלחמה הבאה
יובל טיסונה - המלחמה הבאהיובל טיסונה - המלחמה הבאה
יובל טיסונה - המלחמה הבאה
 
עמוס גבע - StandWithUs
עמוס גבע - StandWithUsעמוס גבע - StandWithUs
עמוס גבע - StandWithUs
 
בן לנג - Iron Dome Count
בן לנג - Iron Dome Countבן לנג - Iron Dome Count
בן לנג - Iron Dome Count
 
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידיםיחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
 
האם ויקיפדיה מונגשת לאנשים עם מוגבלויות?
האם ויקיפדיה מונגשת לאנשים עם מוגבלויות? האם ויקיפדיה מונגשת לאנשים עם מוגבלויות?
האם ויקיפדיה מונגשת לאנשים עם מוגבלויות?
 
IPv6 - Global Adoption - Ran Liberman
IPv6 - Global Adoption - Ran LibermanIPv6 - Global Adoption - Ran Liberman
IPv6 - Global Adoption - Ran Liberman
 
implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...
implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...
implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...
 
IPv6 training guide - Yuval Shaul
IPv6 training guide - Yuval ShaulIPv6 training guide - Yuval Shaul
IPv6 training guide - Yuval Shaul
 
פתיחה - יום השקת IPv6 בישראל
פתיחה - יום השקת IPv6 בישראלפתיחה - יום השקת IPv6 בישראל
פתיחה - יום השקת IPv6 בישראל
 
How I learned to stop writing CSS and start writing SASS
How I learned to stop writing CSS and start writing SASSHow I learned to stop writing CSS and start writing SASS
How I learned to stop writing CSS and start writing SASS
 
אבטחת מידע לעובדים בארגון
אבטחת מידע לעובדים בארגוןאבטחת מידע לעובדים בארגון
אבטחת מידע לעובדים בארגון
 
מכללת ספיר - W3C - תהליכים וטכנולוגיות
מכללת ספיר - W3C - תהליכים וטכנולוגיותמכללת ספיר - W3C - תהליכים וטכנולוגיות
מכללת ספיר - W3C - תהליכים וטכנולוגיות
 
Mobile web design Eyal Sela
Mobile web design   Eyal SelaMobile web design   Eyal Sela
Mobile web design Eyal Sela
 
HTML5, ווב נייד ותקנים פתוחים ברשת
HTML5, ווב נייד ותקנים פתוחים ברשת HTML5, ווב נייד ותקנים פתוחים ברשת
HTML5, ווב נייד ותקנים פתוחים ברשת
 

Accessibility and css - Lisa Seeman

  • 2. Accessibility – not the “average user” Getting your content to everyone:  Disabilities  Visual disabilities  Hearing disabilities  Physical disabilities  Cognitive or neurological disabilities  Other interoperability Scenarios  AT  Screen readers, brail readers, magnification, key pad etc
  • 3. Our hero W3C WAI - United approach so that all different player work together  WCAG (Web Content Accessibility Guidelines)  UAG (User Agent Accessibility Guidelines (UAAG)  ATAG (Authoring tools accessibility guidelines)  WAI-ARIA (Accessible Rich Internet Applications)  Other specifications via PF
  • 4. WCAG  Principles – the idea  Checkpoints – what  Success criteria – more detailed what  Techniques – how  See WCAG techniques for CSS
  • 5. WCAG 2.0 WCAG 2.0 Guidelines – not for the “average user”, using a flat screen, mouse …..  1 Perceivable  1.1 Provide text alternatives.  1.2 Alternatives time-based media.  1.3 Adaptable - without losing information or structure.  1.4 Distinguishable (such as color contrast).  2 Operable  2.1 Keyboard accessible  2.2 time to read and use content.  2.3 seizures.  2.4 navigatable,.  3 Understandable  3.1 readable.  3.2 predictable.  3.3 Help users  4 Robust
  • 6. Well formed CSS A bit like separating form and content  Text / function / structure in the mark up  Presentation in CSS Perceivable, adaptable, operable, understandable, robust CSS Techniques - how to do it in CSS  The good  The bad
  • 7. CSS is beautiful  Chapter 1 introduction to accessibility  1.2 Accessibility and CSS Key points Tools • Clear structure in • :before for symbols mark up via heading • Colors for heading levels levels • Easier to follow
  • 8. Using CSS to control visual presentation of text Accessible relationships, Resizable, accessible text CSS can be used to control the visual presentation of text. This will allow users to modify, via the user agent, the visual characteristics of the text to meet their requirement. The text characteristics include aspects such as size, color, font family and relative placement. Text within images has several accessibility problems, including the inability to:  be scaled according to settings in the browser  be displayed in colors specified by settings in the browser or rules in user-defined style sheets  honor operating system settings, such as high contrast
  • 9. Control visual presentation of text >h1 class="overlap"><span class="upper">News</span><br /> >span class="byline">today</span></h1> .overlap { line-height:0.2em; } .upper { text-transform:uppercase; letter-spacing:1em; text- align:left;} .byline { color:red; font-style:italic; font-weight:bold; padding- left:3em; } --------- >p class="startletter">Once upon a time...</p> startletter:first-letter { font-size:2em; color:#990000; vertical- align:middle; }
  • 10. Resizable text Specifying the size of text containers using em units #nav_menu { width: 20em; height: 100em } #nav_list { font-size: 100%; } input.pick { font-size: 100%; width: 10em; } Scaling form elements which contain text p, label, input { font-size: 1em; } input.geomsize {width: 1.2em;height: 1.2em;} (IE only)
  • 11. Stay on the page Allows users to view content in such a way that line length can average 80 characters or less #main_content {max-width: 70em}
  • 12. Margin and padding Using CSS margin and padding rules instead of spacer images for layout design (Non-text Content) table {margin: .5em; border-collapse: collapse; } And better knowledge processing
  • 13. User interface Using CSS to change the presentation of a user interface Component when it receives focus -focus visible, not reliant on color #mainnav a:hover, #mainnav a:active, #mainnav a:focus { background-color: #DCFFFF; color:#000066;}
  • 14. Hide and show  Accessible scripts  Class = visible / invisible..  Hide a portion of the link text span Eg jump to main }height: 1px; width: 1px; position: absolute; overflow: hidden; top:10px; }
  • 15. ARIA Accessible Rich Internet Applications ARIA exposes what is going on in Applications to Assistive technology (adds semantics)  With ARIA States and author-Settable Properties become explicit in internet applications  State … Checked, pressed, value, selected  ARIA states are used to track the state of each control or widget and expose it to the user device  In scripts event toggles state and often class for the visual effect <span class="checkbox" id="chbox1" role="checkbox" aria-checked="true" onkeydown="return checkBoxEvent(event);" onclick="return checkBoxEvent(event);" > Include decorative fruit basket </span> </div>
  • 16. Bad: Inserting non-decorative content Inserting non-decorative content By using :before and :after pseudo-elements and the 'content' property in CSS p.jim:before {content: "Jim: " } p.mary:before { content: "Mary: " } q:before { content: open-quote } q:after { content: close-quote } <p class="jim"> <q>Do you think he's going to make it?</q></p> <p class="mary"> <q>It's not looking good.</q></p> p.fact:before { content: "Fact: "; font-weight: bold; } p.opinion:before { content: "Opinion: "; font-weight: bold; } <p class="fact"> The defendant was at the scene of the crime when it occurred. </p> <p class="opinion"> The defendant committed the crime. </p> Inserting non-decorative content Check pictures are decorative only - with no message or redundant message NOT CSS as intended
  • 17. Bad: Losing the mark up structure  >p class=“heading1”>  >img class=“button”> CSS is presentation Accessibility is interoperability
  • 18. Bad: Changing the meaning of content by positioning information out of the DOM menu1 { .item1 { position: absolute; position: absolute; top: 3em; top: 7em; left: 0em; left: 0em; margin: 0px; margin: 0px } color: red; background-color: white } .item2 { position: absolute; .menu2 { top: 8em; position: absolute; left: 0em; top: 3em; margin: 0px } left: 10em; margin: 0px; color: red; background-color: white }
  • 19. Make sure the DOM makes sense When style sheets are applied, the data are displayed in two columns of "Products" and "Locations." When the style sheets are not applied, the text appears in a definition list which maintains the structure and reading order. <div class="box"> <dl> <dt class="menu1">Products</dt> <dd class="item1">Telephones</dd> <dd class="item2">Computers</dd> <dd class="item3">Portable MP3 Players</dd> <dt class="menu2">Locations</dt> <dd class="item4">Idaho</dd> <dd class="item5">Wisconsin</dd> </dt> </dl> </div> Mark up is content, CSS is the presentation
  • 20. CSS is beautiful – When used for form, not content  Chapter 1 introduction to accessibility  1.2 Accessibility and CSS Key points Tools • Clear structure in • :before for symbols mark up via heading • Colors for heading levels levels • Easier to follow