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

              
                <main>
  <article>
    <h1>Use Empty Alt Attributes for Decorative Images</h1>
    <p>If an image is purely decorative, it's important to convey that to assistive technologies by using an empty alt attribute (<code>alt=""</code>). Without it, screen readers will announce the filename.</p>
    <p>Try browsing the following images with a screen reader. The first image will be announced as <q>Get-Started-BG@2x.png, Image</q> while the second image will be quietly skipped over.</p>

    <section class="examples flow">
      <!--
      🚫 A decorative image's filename will be read aloud to screen readers if the alt attribute is missing,
      -->
      <img src="https://accessibleweb.com/wp-content/uploads/2019/08/Get-Started-BG@2x.png" />

      <!--
      ✅ To avoid this, use an empty alt attribute to inform assistive technology that the image is decorative.
      -->
      <img src="https://accessibleweb.com/wp-content/uploads/2019/08/Get-Started-BG@2x.png" alt="" />
    </section>
  </article>
</main>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600");

:root {
  --space: 1.5rem;
  --radius: 0.5rem;
}

body {
  background-color: #cdcdcd;
  font-family: "Open Sans", sans-serif;
}

p,
li {
  line-height: 1.6;
}

main {
  display: grid;
  place-items: center;
  max-width: 65ch;
  margin: 2rem auto;
  background-color: #fefefe;
  border-radius: var(--radius, 0.25rem);
  padding: var(--space, 1.5rem);
  box-shadow: 15px 10px -10px rgba(0, 0, 0, 0.25);
}

img {
  max-width: 300px;
}

/* Utility Classes */
.flow > * + * {
  margin-top: var(--space, 1.5rem);
}

/* Examples */
.examples {
  display: grid;
  place-items: center;
}

              
            
!

JS

              
                
              
            
!
999px

Console