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

            
              <article>
    <h1>Button component demo</h1>
    <p>These three examples demo the <a href="https://davatron5000.github.io/a11y-nutrition-cards/components/button">Accessiblity Nutrition Card</a> for a button component.</p>
    <hr />
    <h2>Standard button</h2>
    <button>A standard button</button>
    <hr />
    <h2>Button that uses <code>aria-label</code></h2>
    <button aria-label="This is the text a screen reader would read">The aria-label overrides this</button>
    <hr />
    <h2>Button that uses <code>aria-description</code></h2>
    <p id="desc">This paragraph describes the button below.</p>
    <button aria-described-by="desc">Described by "#desc"</button>
</article>
    

            
          
!

CSS

            
              button {
    display: inline-block;
    border: 5px solid #000000;
    padding: 1rem 2rem;
    margin: 0;
    text-decoration: none;
    background: #ffffff;
    color: #000000;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.2rem;
    cursor: pointer;
    text-align: center;
    transition: background 250ms ease-in-out, 
                transform 150ms ease;
    -webkit-appearance: none;
    -moz-appearance: none;
}

button:hover,
button:focus {
    background: #0066cc;
    color: white;
}

button:focus {
    outline: 2px solid #ffffff;
    outline-offset: -10px;
}

button:active {
    transform: scale(0.99);
}


/* Presentational styles */
html {
    height: 100%;    
}

body {
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f3f3;
    font-family: 'Open Sans', sans-serif;
    padding: 1rem 1rem 3rem 1rem;
}

h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 0;
}

h2 {
    font-size: 2.4rem;
    line-height: 1.2;
}

h1, h2 {
    font-family: 'Open Sans Condensed', sans-serif;
}

hr {
    border: none;
    height: 5px;
    background: #000000;
    margin: 4rem 0;
}

hr + h2 {
    margin-top: 0;
}

code {
    color: #e84118;
}

a {
    color: #0066cc;
    text-decoration-skip-ink: auto;
}
            
          
!

JS

            
              const buttons = document.querySelectorAll('button');

buttons.forEach(button => {
    button.addEventListener('click', evt => {
        alert('Attaching a click event to a button gets you ENTER and SPACE key support for free')
    });
});
            
          
!
999px

Console