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

Packages

Add 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 or require. We'll also process your JavaScript with Babel.

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

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.

            
              <h1>Deque University - Accessible Radio Buttons</h1>
<h2>Option 1: Using HTML fieldset and legend elements</h2>
<fieldset class="deque-radio-group">
  <legend class="deque-radio-group-label">What's your favorite flavor of ice cream?</legend>
  <div id="radioGroup">
    <span id="Whatsyourfavoriteflavor_0" class="deque-radio" aria-labelledby="vanilla"></span>
    <span id="vanilla">Vanilla</span>

    <span id="Whatsyourfavoriteflavor_1" class="deque-radio" aria-labelledby="chocolate"></span>
    <span id="chocolate">Chocolate</span>
    <span id="Whatsyourfavoriteflavor_2" class="deque-radio" aria-labelledby="strawberry"></span>
    <span id="strawberry">Strawberry</span>
    <span id="Whatsyourfavoriteflavor_3" class="deque-radio" aria-labelledby="none"></span>
    <span id="none">I prefer cake</span>
  </div>
</fieldset>

<h2>Option 2: Using ARIA role="radiogroup" and aria-labelledby elements</h2>
<div class="deque-radio-group" role="radiogroup" aria-labelledby="inspire">
  <div class="deque-radio-group-label" id="inspire">
    Which one of these scientists most inspires you?</div>
  <div id="radioGroup">
    <span id="Whichoneofthesescientistsmostinspiresyou_0" class="deque-radio" aria-labelledby="curie"></span>
    <span id="curie">Marie Curie</span>
    <span id="Whichoneofthesescientistsmostinspiresyou_1" class="deque-radio" aria-labelledby="goodall"></span>
    <span id="goodall">Jane Goodall</span>
    <span id="Whichoneofthesescientistsmostinspiresyou_2" class="deque-radio" aria-labelledby="franklin"></span>
    <span id="franklin">Rosalind Franklin</span>
    <span id="Whichoneofthesescientistsmostinspiresyou_3" class="deque-radio" aria-labelledby="lamarr"></span>
    <span id="lamarr">Hedy Lamarr</span>
  </div>
</div>
<p>To learn more about ARIA and see even more pattern examples, you can enroll in <a href="https://dequeuniversity.com">Deque University courses</a>.</p>
            
          
!
            
              .deque-radio-group {
  margin: 0;
  padding: 10px;
  border: 0;
}

.deque-radio-group legend,
.deque-radio-group .deque-radio-group-label {
  font-size: 16px;
  display: block;
  line-height: 20px;
  padding-bottom: 5px;
}

.deque-radio-group legend {
  margin-bottom: -10px;
}

.deque-radio-label {
  font-size: 15px;
  margin-right: 24px;
  padding-bottom: 0;
  position: relative;
  cursor: default;
  display: inline-block;
  margin-left: 28px;
  line-height: 1.75;
}

.deque-radio[role='radio'] {
  cursor: default;
  user-select: none;
  font-size: 15px;
  line-height: 20px;
  margin-right: 24px;
  padding-bottom: 0;
  position: relative;
  display: block;
  margin-top: 2px;
}

.deque-radio[role='radio']:hover {
  opacity: 0.75;
}

.deque-radio[role='radio'] .deque-radio-focused {
  outline: 1px dashed #000000;
}

.deque-radio[role='radio'] .deque-radio-indicator {
  border: solid #000000 1px;
  border-radius: 50%;
  height: 20px;
  width: 20px;
  position: absolute;
}

.deque-radio[role='radio'][aria-checked='true'] .deque-radio-indicator {
  border-color: #006cc1;
}

.deque-radio[role='radio'][aria-checked='true'] .deque-radio-indicator:before {
  background: currentColor;
  border-radius: 50%;
  height: 10px;
  width: 10px;
  border: 1px solid #ffffff;
  content: ' ';
  left: 4px;
  position: absolute;
  top: 4px;
}
.deque-radio[role='radio'][aria-checked='mixed'] .deque-radio-indicator {
  background: #ffffff;
}

.deque-radio[role='radio'] ul[role='radiogroup'] {
  list-style-type: none;
}

            
          
!
            
              // The minified JavaScript used for this example can be found in the pen settings. 
            
          
!
999px

Console