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

              
                <section>
  <div class="overlay"></div>
  <video src="https://s3.amazonaws.com/akamai.netstorage/HD_downloads/Orion_SM.mp4" autoplay loop muted></video>
  <div>
    <h1>VIDEO ON BACKGROUND</h1>
    <p>The <em>object-fit</em> CSS property specifies how the contents of a replaced element should be fitted to the box established by its used height and width (from <a href="https://developer.mozilla.org/pt-BR/docs/Web/CSS/object-fit">MDN</a>).</p>
    <button>BUTTON</button>
  </div>
</section>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Open+Sans:600,800|Droid+Serif:400,400italic');

*
  font-family inherit
  box-sizing border-box
  
body
  margin 0
  font-family 'Open Sans'
  
section
  display flex
  justify-content center
  align-items center
  width 100%
  height 100vh
  overflow hidden
  
video
  position absolute
  top 0
  left 0
  display block
  width 100%
  height 100%
  object-fit cover
  
div
  z-index 1
  width 40rem
  text-align center
  text-shadow 1px 1px 1px #000
  color #fefefe
  
a
  color #e55
  
h1
  line-height 1.125
  margin 0
  font-family 'Open Sans'
  font-size 4rem
  font-weight 800
  
p
  line-height 1.25
  margin 1rem 0
  font-family 'Droid Serif' 
  
button 
  cursor pointer
  padding 0.5rem
  border 1px solid transparent
  border-radius 0.25rem
  color #fefefe
  background-color #e55
  font-weight 600
  transition .2s ease
  
  &:hover
    background-color darken(#e55, 10%)
  
.overlay
  position absolute
  z-index 1
  top 0
  left 0
  width 100%
  height 100%
  background-color rgba(0, 0, 0, 0.5)
              
            
!

JS

              
                
              
            
!
999px

Console