Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


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.

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.



  <!-- viewport meta must come before any media queries -->
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=2.0, user-scalable=yes, shrink-to-fit=no" />
  <link rel="stylesheet" href="" />
  <script async src=""></script>

  <link rel="preload" href="" as="image" media="all and (min-device-width:480px)">
  <link rel="preload" href="" as="image" media="all and (max-device-width:479px)">

      My Shop
      <span class="width-display" id="width-display">TBD</span>
  <div class="html5-video-player">
    <video id="hero-video" class="html5-video js-html5-video full-width-video " tabindex="0" loop autoplay playsinline loop muted data-desktop-src="" data-desktop-poster="" data-mobile-src="" data-mobile-poster="">
      const WIDE_VIEWPORT = 480;
      function resizeVideo(wideViewport) {
        let videoEl = document.getElementById("hero-video");

        let src = videoEl.dataset.mobileSrc;
        let poster = videoEl.dataset.mobilePoster;
        let widthDisplay = 'MOBILE';

        if (wideViewport.matches) {
          src = videoEl.dataset.desktopSrc;
          poster = videoEl.dataset.desktopPoster;  
          widthDisplay = 'DESKTOP';
        videoEl.src = src
        videoEl.poster = poster
        document.getElementById('width-display').textContent = widthDisplay;

      const wideViewport = window.matchMedia(`(min-width: ${WIDE_VIEWPORT}px)`)
  <p>Bacon ipsum dolor amet frankfurter filet mignon pork loin buffalo, bacon bresaola beef ribs pig flank meatloaf ham hock chuck ground round shoulder. Spare ribs biltong pork chop pig, pork sirloin capicola. Tri-tip fatback tongue, capicola filet mignon landjaeger t-bone salami buffalo ball tip spare ribs. Picanha ham kevin brisket leberkas. Hamburger bresaola t-bone, leberkas ham chicken strip steak pork belly tongue buffalo turkey chislic ham hock shoulder. Pig pancetta capicola cupim flank. Cow jowl filet mignon, ribeye spare ribs t-bone burgdoggen fatback frankfurter ham tongue sirloin salami.</p>



                body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
header {
  position: relative;
  left: 0;
  top: 0;
  height: 2em;
  background: purple;
  padding: 0.5em;
  text-align: center;
header h1 {
  margin: -4px;
  color: white;
.full-width-video {
  width: 100%;
  aspect-ratio: 1280 / 960; /* width and height of the mobile video */
  background-color: black; /* to show pre-allocated space */
/* override for desktop */
@media only screen and (min-width: 480px) {
  .full-width-video {
    aspect-ratio: 1280 / 480;
.width-display {
  font-size: 80%;
  position: absolute;
  right: 1vw;
  display: block;
  top: 8px;