css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>Using <code>aria-labelledby</code> with Lists</h1>

<p>An example of using <code>aria-labelledby</code> with heading and list elements to help give context. Inspired by <a href="https://twitter.com/ted_drake/">@ted_drake</a>'s blog entry: <a href="http://www.last-child.com/aria-labelledby-on-lists/">Use aria-labelledby to provide context to unordered lists</a>.

<section class="example">
  <h2 id="movie-list">Star Wars Saga</h2>
  <ul aria-labelledby="movie-list">
    <li>Episode I: The Phantom Menace</li>
    <li>Episode II: Attack of the Clones</li>
    <li>Episode III: Revenge of the Sith</li>
    <li>Episode IV: A New Hope</li>
    <li>Episode V: The Empire Strikes Back</li>
    <li>Episode VI: Return of the Jedi</li>
    <li>Episode VII: The Force Awakens</li>
  </ul>
</section>

<h2>Support</h2>

<table>
  <caption>Screen Readers &mdash; Lists with <code>aria-labeledby</code> Support</caption>
  <thead>
    <tr>
      <th scope="col">Screen Reader</th>
      <th scope="col">Supported</th>
      <th scope="col">Notes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">ChromeVox</th>
      <td data-support="false">No</td>
      <td>Using <code>Ctrl + Cmd + Right arrow</code>, announces list element, then first list item.</td>
    </tr>
    <tr>
      <th scope="row">JAWS</th>
      <td data-support="true">Yes</td>
      <td>IE &amp; Firefox, using <code>L</code> to navigate between lists, list is announced with title and item count.</td>
    </tr>
    <tr>
      <th scope="row">NVDA</th>
      <td data-support="false">No</td>
      <td>IE &amp; Firefox, using <code>L</code> to navigate between lists, list is announced with item count, then first item.</td>
    </tr>
    <tr>
      <th scope="row">Orca</th>
      <td data-support="false">No</td>
      <td>Firefox, using <code>L</code> to navigate between lists, list is announced with item count, then first item.</td>
    </tr>
    <tr>
      <th scope="row">Talkback</th>
      <td data-support="false">No</td>
      <td>Chrome, on touch, only list item content is announced.</td>
    </tr>
    <tr>
      <th scope="row">VoiceOver</th>
      <td data-support="true">Yes</td>
      <td>Using <code>Crtl + Opt + Right arrow</code> to navigate content, list heading announced twice (sometimes?) in Chrome and Firefox, once in Safari.</td>
    </tr>
    <tr>
      <th scope="row">VoiceOver (iOS)</th>
      <td data-support="true">Yes</td>
      <td>Safari, on touch, list title then item content is announced.</td>
    </tr>
  </tbody>
</table>
  
            
          
!
            
              .example {
  background-color: WhiteSmoke;
  border: solid Silver 1px;
  border-radius: .5rem;
  margin: 3em 0;
  padding: .5em 2em;
}

.example h2 {
  margin: 1rem 0;
}

table {
  border: solid lightgrey 1px;
  border-collapse: collapse;
}

caption {
  padding: 1em;
}

th,
td {
  border: solid lightgrey 1px;
  padding: 1em;
  text-align: left;
}

th[scope="col"] {
  background-color: black;
  color: white;
}

td[data-support="true"] {
  background-color: lightgreen;
}

td[data-support="false"] {
  background-color: lightpink;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console