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

            
              <h1>Testing fallbacks</h1>

<p>Per the spec, browsers don’t currently expose the fallback content for a media block (`picture`, `video`, `audio`) when they do not support the media type. I wonder if they should. Seems like it might be useful from a UX standpoint.</p>

<p>I’m intrigued by the notion for a few reasons:</p>

<ol>
  <li>It supports use cases where an author may not have the media available in web safe formats (or may not have the skill or knowledge necessary to convert).</li>
  <li>It supports the CMS use case where content authors may upload content that is not safe for all browsers (e.g. FLAC).</li>
  <li>It is both forward and backward compatible, allowing us to use newer media formats without reducing the usability of a page in older, non-supportive browsers.</li>
</ol>

<p>Note: I’m adding borders to the elements so you see them</p>

<h2>Example 1a: <code>video</code> with no supported <code>source</code> and no poster</h2>

<video>
  <source src="http://www.engr.colostate.edu/me/facil/dynamics/files/drop.avi" type="video/avi">
  <p>Your browser doesn’t support AVI, but you can <a href="http://www.engr.colostate.edu/me/facil/dynamics/files/drop.avi" download>download this movie</a></p>
</video>

<h2>Example 1b: <code>video</code> with no supported <code>source</code> with a poster</h2>

<video poster="https://www.aaron-gustafson.com/i/posts/2017-03-31/video-avi-poster.jpg">
  <source src="http://www.engr.colostate.edu/me/facil/dynamics/files/drop.avi" type="video/avi">
  <p>Your browser doesn’t support AVI, but you can <a href="http://www.engr.colostate.edu/me/facil/dynamics/files/drop.avi" download>download this movie</a></p>
</video>

<h2>Example 2: <code>audio</code> with no supported <code>source</code></h2>

<audio>
  <source src="http://www.lindberg.no/hires/test/2L-106/2L-106_stereo_PCM-96k_MAGNIFICAT_04.flac" type="audio/flac">
  <p>Your browser doesn’t support FLAC, but you can <a href="http://www.lindberg.no/hires/test/2L-106/2L-106_stereo_PCM-96k_MAGNIFICAT_04.flac" download>download this track</a></p>
</audio>

<h2>Example 3: <code>picture</code> with no supported <code>source</code></h2>

<picture>
  <source src="http://libmng.com/MNGsuite/images/PNGBASxx.mng" type="video/x-mng">
  <p>Your browser doesn’t support MNG files, but you can <a href="http://libmng.com/MNGsuite/images/PNGBASxx.mng" download>download the image</a></p>
</picture>

<p>(Yes, I know the <code>picture</code> is invalid. I left out the <code>img</code> intentionally, for parity.)</p>
            
          
!

CSS

            
              body {
  padding: 0 1em;
  max-width: 50rem;
}
video, audio, picture {
  display: block;
  border: 1px solid;
}
            
          
!

JS

            
              
            
          
!
999px

Console