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

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.

HTML

              
                <div class="text-wrapper">

  Showing how the article element can be enhanced to help a user find specially marked up products. Items with a prominent border have aria-label applied.

  <h2>Compatibility</h2>

  <ul>
    <li>NVDA doesn’t announce the article element or list it.</li>
    <li>JAWS lists the articles and infers the label from the article contents but does use the aria labelling if existing.</li>
    <li>VoiceOver on iOS lists the article if a rotor setting for articles is turned on but ignores the aria labelling.</li>
    <li>VoiceOver on MacOS lists all articles, and only provides the custom label for those articles which have it.</li>
  </ul>
  
</div>

<div class="wrapper">
 
  <article class="product" aria-label="">
    <img src="https://placehold.co/100x100" alt="">
    <h2 class="product-name">Noshu 95% Sugar Free Banana Bread Slices | 240g</h2>
$6.00
  </article>
  
  <article class="product" aria-labelledby="name0 special0">
    <img src="https://placehold.co/100x100" alt="">
    <h2 class="product-name" id="name0">Tip Top Spicy Fruit English Muffins | 6 pack</h2>
    $2.50
<div id="special0">Down down discount</div>
  </article>
  
  <article class="product" aria-labelledby="name1 special1">
    <img src="https://placehold.co/100x100" alt="">
    <h2 class="product-name" id="name1">High Fibre Wholemeal Bread | 700g</h2>
$3.50
    <div id="special1">Special Buy 2 for $6</div>
  </article>
  
  <article class="product">
    <img src="https://placehold.co/100x100" alt="">
    <h2 class="product-name">Cheese & Bacon Rolls | 4 pack</h2>
$4.80
  </article>
  
  <article class="product" aria-labelledby="name2 special2">
    <img src="https://placehold.co/100x100" alt="">
    <h2 class="product-name" id="name2">Wonder White Bread Wholemeal Plus Iron | 700g</h2>
$4.40
    <div id="special2">Special pick 2 for $8</div>
  </article>
</div>


  

              
            
!

CSS

              
                $color-cta: #369;

body{
  font-family: sans-serif;
  font-size: 16px;
}

code
{
  background:black;
  color:white;
  padding:3px;
}

.text-wrapper
{
  width:50%;
  margin: 2em;
}

.wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-gap: 1rem;
  margin: 2em;
  
  article[aria-labelledby] {
    border: 4px solid #0A5470;
  }
  
  article {
    border: 1px solid #eee;
  }
  
  article.product {
    display: flex;
    flex-flow: column;
    
    padding: 1em;

    .product-name {
      margin: 1em 0;
      font-size: 1.1rem;
      font-weight: 700;
      text-transform: uppercase;
    }
    
    div{
      padding-top:30px;
      font-weight:bold;
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console