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

              
                <!-- this is the markup, keep your hands off! -->

<form>
  <label for="email">Subscribe to our mailing list</label>
  <input type="email" value="" name="email" placeholder="email address" required>
  <input type="submit" value="Subscribe" name="subscribe">
</form>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Roboto);

$text: #212121;
$deep-purple-50: #EDE7F6;
$deep-purple-800: #4527A0;
$green-500: #4CAF50;
$green-900: #1B5E20;
$orange-500: #FF9800;
$orange-900: #E65100;
$white: #fff;
$divider: #DADADA;

body {
  font-family: 'Roboto', sans-serif;
  background-color: $deep-purple-50;
  font-size: 16px;
  color: $text;
}

form {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);  
  background-color: $white;
  box-shadow: 0 5px 10px rgba(0,0,0,.3),
    0 0 10px 2px rgba(0,0,0,.2);
}

label {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 24px 48px;
  font-size: 1.5rem;
  text-align: center;
  background-color: $deep-purple-800;
  color: $white;
}

input {
  margin: 32px 24px;
  display: block;
  width: calc(100% - 48px);
  border-radius: 0;
  -webkit-appearance: none;
  padding: 0;
}

input[type=email] {
  position: relative;
  font-size: 1rem;
  line-height: 2.4rem;
  border: none;
  border-bottom: 1px solid $divider;
  background-color: transparent;
  transition: border-color .2s .3s ease-out;

  &:focus,
  &:valid {
    border-bottom-width: 2px;
    outline: none;
    margin-bottom: -1px;
  }
  
  &:focus {
    border-bottom-color: $orange-500;    
  }
  
  &:valid {
    border-bottom-color: $green-500;
  }
}

/* it's a single field, no need for an autocomplete indicator. Unfortunately this is buggy there is still a small yellow line on the border-top sometimes */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px $white inset;
}

/* set the placeholder color */
::-webkit-input-placeholder { 
    color:   $divider;
}
:-moz-placeholder { 
   color:    $divider;
   opacity:  1;
}
::-moz-placeholder {
   color:    $divider;
   opacity:  1;
}
:-ms-input-placeholder {
   color:    $divider;
}

input[type=submit] {
  position: relative;
  margin-bottom: 24px;
  text-transform: uppercase;
  padding: 16px;
  background-color: $green-500;
  color: $white;  
  font-size: 1rem;
  transition: background-color .2s .3s ease-out, box-shadow .2s .3s ease-out;  outline: none;
  cursor: pointer;
  border: none;
  border-radius: 2px;
  box-shadow: 0 2px 0 $green-900;
  
  &::-moz-focus-inner {  
    border: 0;
  }
  
  &:hover,
  &:focus {
    background-color: $green-500; 
  }

  &:active {
    top: 2px;
    box-shadow: none;
  }
}

/* disable the button for invalid email adresses */
input[type=email]:invalid + input[type=submit] {
  background-color: $orange-500;
  box-shadow: 0 2px 0 $orange-900;
  cursor: not-allowed;
  
  &:active {
    top: 0;
    box-shadow: 0 2px 0 $orange-900;  
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console