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

+ 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

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.

HTML

              
                <!-- Video from https://coverr.co/ -->
<article>
  <div class="video-wrapper">
    <h1 class="leading-none p-4 text-white text-3xl uppercase video-title md:p-8 md:text-5xl">
      Video Background
    </h1>
    <video autoplay loop muted class="w-full">
      <source src="https://petermedina.com/video/beach.mp4" type="video/mp4" />Your browser does not support the video tag.
      <source src="https://petermedina.com/video/beach.webm" type="video/webm" />Your browser does not support the video tag.
    </video>
  </div>

  <div class="leading-normal mx-auto my-12 px-4 max-w-md">
    <p class="mb-4 md:text-xl">Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem error iure quo ea dolore, iste ad assumenda ducimus sunt. Rerum nulla ipsum unde exercitationem ea atque explicabo tempore perferendis delectus?</p>
    <p class="md:text-xl">Laudantium cumque mollitia maxime, magni pariatur blanditiis laborum quisquam. Iure veniam deserunt debitis minus animi at fugiat doloremque a tempore obcaecati adipisci voluptate molestiae, amet odio, unde velit! Dolore, molestiae.</p>
  </div>
</article>
              
            
!

CSS

              
                .video-title {
  background: #000;
}

@media only screen and (min-width : 768px) {
  .video-wrapper {
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    width: 100%;
  }

  .video-wrapper video {
    height: 100%;
    position: absolute;
      top: 0;
      left: 0;
    width: 100%;
  }

  .video-title {
    background-color: rgba(0,0,0, .7);
    position: absolute;
      top: 50%;
      left: 50%;
    transform: translateX(-50%);
    z-index: 99;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console