Make Elements Only Visible to a Screen Reader by Using Custom CSS

Make Elements Only Visible to a Screen Reader by Using Custom CSS


Tell us what’s happening:
Just a question: if the person is visually troubled, why would they care what position the table is in? They cannot see it.

Your code so far

  .sr-only {
    position: ;
    left: ;
    width: ;
    height: ;
    top: auto;
    overflow: hidden;
        <li><a href="#stealth">Stealth &amp; Agility</a></li>
        <li><a href="#combat">Combat</a></li>
        <li><a href="#weapons">Weapons</a></li>
    <h2>Master Camper Cat's Beginner Three Week Training Program</h2>
      <!-- Stacked bar chart of weekly training-->
      <p>[Stacked bar chart]</p>
      <br />
      <figcaption>Breakdown per week of time to spend training in stealth, combat, and weapons.</figcaption>
    <table class="sr-only">
      <caption>Hours of Weekly Training in Stealth, Combat, and Weapons</caption>
          <th scope="col">Stealth &amp; Agility</th>
          <th scope="col">Combat</th>
          <th scope="col">Weapons</th>
          <th scope="col">Total</th>                                        
          <th scope="row">Week One</th>
          <th scope="row">Week Two</th>
          <th scope="row">Week Three</th>
  <section id="stealth">
    <h2>Stealth &amp; Agility Training</h2>
    <article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
    <article><h3>No training is NP-complete without parkour</h3></article>
  <section id="combat">
    <h2>Combat Training</h2>
    <article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
    <article><h3>Goodbye, world: 5 proven ways to knock out an opponent</h3></article>
  <section id="weapons">
    <h2>Weapons Training</h2>
    <article><h3>Swords: the best tool to literally divide and conquer</h3></article>
    <article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
  <footer>&copy; 2016 Camper Cat</footer>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:


They don’t care about the table position, you do. In this sample the visual chart is the [Stacked Bar Chart] (there is no actual chart there, just text to represent one). The table should not be visible to you. The table is what the screen Reader would translate to the visually impaired user in place of the [stacked bar chart] which they would have trouble interpreting. The CSS is using absolute positioning to place the table off the screen so you or I do not see it but it still exists (for the screen reader).

Hope that helps.

position: absolute;
left: -10000px;
width: 1px;
height: 1px;
top: auto;
overflow: hidden;