Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

              
                <h1>Automated ARIA Role Assignment</h1>
<p>
  These examples are not responsive. They exist solely to demonstrate the functions.
</p>

<h2>Unordered List</h2>
<ul>
  <li>4 cups of strawberries.</li>
  <li>1 tablespoon of sugar.</li>
  <li>3 tablespoons balsamic vinegar (higher-end stuff is best).</li>
  <li>¼ teaspoon of coarse-ground black pepper.</li>
</ul>

<h2>Ordered List</h2>
<ol>
  <li>Halve the strawberries (tossing away the leaves).</li>
  <li>Toss the strawberries with the balsamic vinegar, pepper, and the tablespoon of sugar.</li>
  <li>Cover and let stand 30 minutes.</li>
  <li>Stir before serving over scoops of vanilla ice cream.</li>
</ol>

<h2>Definition / Description List</h2>
<dl>
  <dt>Makes</dt>
  <dd itemprop="recipeYield">Two quarts.</dd>
  <dt>Time</dt>
  <dd><time itemprop="totalTime" datetime="PT1H">1 hour.</time></dd>
  <dt>Calories for the entire batch</dt>
  <dd itemprop="totalCalories">~800 calories.</dd>
</dl>
              
            
!

CSS

              
                body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.4;
  /*   line-height: 1.5; */
  /*   letter-spacing: 0.12em; */
  /*   word-spacing: 0.16em; */
}
              
            
!

JS

              
                function AddListARIA() {
  try {
    var allLists = document.querySelectorAll("ol, ul");
    for (var i = 0; i < allLists.length; i++) {
      allLists[i].setAttribute("role", "list");
    }
    var allListItems = document.querySelectorAll("li");
    for (var i = 0; i < allListItems.length; i++) {
      allListItems[i].setAttribute("role", "listitem");
    }
    var allDefLists = document.querySelectorAll("dl");
    for (var i = 0; i < allDefLists.length; i++) {
      allDefLists[i].setAttribute("role", "associationlist list");
    }
    var allDefTerms = document.querySelectorAll("dt");
    for (var i = 0; i < allDefTerms.length; i++) {
      allDefTerms[i].setAttribute("role", "associationlistitemkey listitem");
    }
    var allDefItems = document.querySelectorAll("dd");
    for (var i = 0; i < allDefItems.length; i++) {
      allDefItems[i].setAttribute("role", "associationlistitemvalue listitem");
    }
  } catch (e) {
    console.log("AddListARIA(): " + e);
  }
}

AddListARIA();

              
            
!
999px

Console