Pen Settings



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


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


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.


Auto Save

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.


                <h1>Content Group</h1>
<p>How to wrap an image, link, and text as one large touch target, while using progressively enhanced, valid HTML and keeping things fully accessible.</p>

<article class="article-teaser js-content-group" data-url="" data-title="Google">  
  <img src="" width="200" height="150" alt=""/>  
    <a href="">Google</a>
  <p>Search the internet for things.</p>  

<article class="article-teaser js-content-group" data-url="" data-title="Apple">  
  <img src="" width="200" height="150" alt=""/>  
    <a href="">Apple</a>
  <p>This one points to the Apple homepage.</p>  

<article class="article-teaser js-content-group" data-url="" data-title="A11Y Project">  
  <img src="" width="200" height="150" alt=""/>  
    <a href="">A11YProject</a>
  <p>One more for testing purposes.</p>  

  <li>The idea behind this is to minimize the amount of tab presses required by keyboard users to navigate through content.</li>
  <li>Inspired after watching this video from Nomensa: <a href="">Tips on combining image and text links</a>.</li>
  <li>This concept is also a <a href="">WCAG 2.0 technique requirement</a>.</li>
  <li>Tested with NVDA+Firefox, ChromeVox, and VoiceOver+Chrome.</li>
  <li><a href="">jQuery version</a>.</li>


                a {
  text-decoration: none;

.article-teaser {
  border: solid LightGray 1px;
  display: inline-block;
  margin: 0 1em 1em 0;
  max-width: 10em;

.article-teaser img {
  height: auto;
  max-width: 100%;
.article-teaser h2 {
  padding: 0 .5em;
.article-teaser p {
  padding: 0 1em;

.clickable {
  cursor: pointer;


                (function (document, window, undefined) {
  'use strict';
  // Vars
  var contentGroup = document.querySelectorAll('.js-content-group');
  // For each
  [], function(group, index) {
    // Vars
    var link = group.querySelector('a'),
        title = group.querySelector('h2'),
        text = group.querySelector('p');
    // Set attributes
    link.setAttribute('tabindex', '-1');    
    title.setAttribute('id', 'group-title-' + index);    
    text.setAttribute('id', 'group-text-' + index);
    text.setAttribute('aria-hidden', 'true');
    // Group "button" attibutes
    group.setAttribute('tabindex', '0');
    group.setAttribute('role', 'link');
    group.setAttribute('aria-labelledby', 'group-title-' + index);
    group.setAttribute('aria-describedby', 'group-text-' + index);
    // Click event
    group.addEventListener('click', function () {
      window.location.href = this.getAttribute('data-url');      
    }, false);
    // Keydown event
    group.addEventListener('keydown', function (event) {
      if (event.which === 13) {
        window.location.href = this.getAttribute('data-url');      
    }, false);
})(document, window);