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.


                <div class="video-container">
  <video autoplay loop="true" width="1280" height="720">
    <source type="video/mp4" src="">
    <source type="video/webm" src="">
    <source type="video/ogg" src="">
  <div class="overlay">
    <h1>Emulating background-size: cover for HTML5 video</h1>
    <p>Simply forcing the video to have a <code>min-width</code> and <code>min-height</code> of <code>100%</code> will stretch it to fill! Set <code>width</code> and <code>height</code> to <code>auto</code> to keep the video's aspect ratio. No need for Javascript!</p>
    <p>Original pen with Javascript solution: <a href="">Emulating background-size: cover for HTML5 video</a>.</p>
    <p>Example video: <a href="">Pink Vynil by Beeple</a></p>


                .video-container {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%; 
  overflow: hidden;

.video-container video {
  /* Make video to at least 100% wide and tall */
  min-width: 100%; 
  min-height: 100%; 
  /* Setting width & height to auto prevents the browser from stretching or squishing the video */
  width: auto;
  height: auto;
  /* Center the video */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);


body { 
  background: #000;
  color: #fff;
  font-family: 'Oxygen', sans-serif;
.overlay {
  background: rgba(0,0,0,0.5);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 95%;
  max-width: 45em;
  margin: auto auto 1em;
  box-sizing: border-box;
  padding: 2em;
  line-height: 1.5;
  text-align: center;
  :last-child { margin-bottom: 0; }

  h1 {
    font-size: 14pt;
    font-weight: normal;
    text-shadow: 0 0 .3em #000;
    margin: 0 0 1em;

  p {
    font-size: 11pt;
    text-shadow: 0 0 .3em #000;
    margin: 1em 0;
  a {
    color: #fff;

code { font-family: monospace; }