Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML

              
                <h1>Hiding symbols from screen readers</h1>
<h2>buttons without any symbol hiding mechanism</h2>
<div class="buttons">
  <button class='btn btn-success'><span class="icon-checkmark"></span> Accept</button>
  <button class='btn btn-danger'><span class="icon-cancel-2"></span> Cancel</button>
  <button class='btn btn-info'>☹</button>
  <button class='btn btn-warning'>☀</button>
  <button class='btn btn-inverse'><span class="icon-ppt"></span></button>
</div>
<h2>buttons with aria-hidden="true"</h2>
<div class="buttons">
  <button class='btn btn-success'><span class="icon-checkmark" aria-hidden="true"></span> Accept</button>
  <button class='btn btn-danger'><span class="icon-cancel-2" aria-hidden="true"></span> Cancel</button>
  <button class='btn btn-info'><span aria-hidden="true">☹</span></button>
  <button class='btn btn-warning'><span class="icon-excel" aria-hidden="true"></span></button>
  <button class='btn btn-inverse'><span class="icon-ppt" aria-hidden="true"></span></button>
</div>

<!-- <h2>buttons with role="img" and aria-label=""</h2>
<div class="buttons">
  <button class='btn btn-success'><i class="icon-checkmark" role="img" aria-label=""></i>  Accept</button>
  <button class='btn btn-danger'><i class="icon-cancel-2" role="img" aria-label=""></i>  Cancel</button>
  <button class='btn btn-info'><i class="icon-word" role="img" aria-label=""></i> Word</button>
  <button class='btn btn-warning'><i class="icon-excel" role="img" aria-label=""></i> Excel</button>
  <button class='btn btn-inverse'><i class="icon-ppt" role="img" aria-label=""></i>  PPT</button>
</div> -->
<h2>buttons with aria-label="label text" on the button element</h2>
<div class="buttons">
  <button class='btn btn-success' aria-label="Accept"><span class="icon-checkmark"></span>  Accept</button>
  <button class='btn btn-danger' aria-label="Cancel"><span class="icon-cancel-2"></span>  Cancel</button>
  <button class='btn btn-info' aria-label="Word">☹</button>
  <button class='btn btn-warning' aria-label="Excel"><span class="icon-excel"></span></button>
  <button class='btn btn-inverse' aria-label="PPT"><span class="icon-ppt"></span></button>
</div>
<h2>Notes:</h2> 
<p>For symbols in non interactive elements <code>aria-hidden=true</code> works fine
 <span class="icon-cancel-2" aria-hidden="true"></span></p>
<pre>&lt;span <mark>aria-hidden="true"</mark>&gt;&lt;/span&gt;</pre>
<p>For symbols in interactive elements <code>aria-hidden=true</code> does not work robustly due to the way Firefox supports <code>aria-hidden</code>,  a more robust methods is add the <a href="https://w3c.github.io/accname/#dfn-accessible-name">accessible name</a> (label) to the <code>button</code> element.
   <button aria-label="Peace"><span class="icon-cancel-2"></span></button></p>
<pre>  &lt;button <mark>aria-label="Peace"</mark>&gt;&lt;span&gt;&lt;/span&gt;&lt;/button&gt;</pre>

              
            
!

CSS

              
                

/* apply a natural box layout model to all elements */
* {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}




span {
      
  font-weight: bold;
  font-style: normal;
  margin-right: 3px;
}
 



.icon-word:before {
        content: "☹ ";
}
.icon-ppt:before {
        content: "▶";
}
.icon-excel:before {
        content: "☀ ";
}
.icon-film:before {
        content: "☠ ";
}
.icon-pdf:before {
        content: "\5d";
}
.icon-cancel-2:before {
        content: "☮ ";
}
.icon-checkmark:before {
        content: "✔";
}

div.buttons{
 
padding: 2em;
}
              
            
!

JS

              
                
              
            
!
999px

Console