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.

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

              
                <!-- 

  Visually validate an input before submission
  - Make the submit button disabled until the required input is filled.
  - Highlight the form when the inner input has focus.

  ---

  Tachyons is optional. 

  You can merely use the following:
  <form id="form">
    <label for="email">Email Address</label>
    <input placeholder="Your email address" type="email" id="email" required>
    <button type="submit" id="submit">Subscribe</button>
  </form>

-->

<div class="ma4">
  <form id="form" class="bg-light-gray mw7 center pa4 mt5 br2-ns ba b--black-10">
    <div class="cf">
      <label class="clip" 
             for="email">
        Email Address
      </label>
      <input class="f6 f5-l input-reset bn fl black-80 bg-white pa3 lh-solid w-100 w-75-m w-80-l br2-ns br--left-ns" 
             placeholder="Your email address" 
             type="email" 
             id="email"
             required>
      <button class="f6 f5-l button-reset fl pv3 tc bn bg-green hover-bg-green white pointer w-100 w-25-m w-20-l br2-ns br--right-ns" 
             type="submit"
             id="submit">
        Subscribe
      </button>
    </div>
  </form>
</div>
              
            
!

CSS

              
                #form:focus-within {
  box-shadow: 0 4px 6px rgba(0, 0, 0, .3);
  transform: translateY(-1px);
}

#email:placeholder-shown + #submit:not(:focus) {
  opacity: .5;
  pointer-events: none;
}

/* 
  That's all!
  
  http://caniuse.com/#feat=css-placeholder-shown 
  http://caniuse.com/#feat=css-focus-within
*/
              
            
!

JS

              
                // https://catalin.red/visually-validate-input-using-css/
              
            
!
999px

Console