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

              
                <div class="container">
  <form>
    <div class="inputWrapper">
      <input class="input" type="text" name="firstname" value="" placeholder="First Name">
      <label class="label" for="input">First Name</label>
      <span class="info"><i class="fa fa-info-circle"></i> Please add your first name.</span>
    </div>

    <div class="inputWrapper">
      <input class="input" type="text" name="lastname" value="" placeholder="Last Name*" required>
      <label class="label" for="input">Last Name</label> 
      <span class="info"><i class="fa fa-info-circle"></i> Please add your last name.</span>
    </div>

    <div class="inputWrapper">
      <input class="input input--error" type="text" name="input" value="" placeholder="First Name*" required>
      <label class="label" for="input">First Name</label>
      <span class="info info--isVisible info--error"><i class="fa fa-info-circle"></i> This is an error message.</span>
    </div>

    <div class="inputWrapper">
      <input class="input input--warning" type="text" name="input" value="" placeholder="Account Number*" required>
      <label class="label" for="input">Account Number</label>
      <span class="info info--isVisible info--warning"><i class="fa fa-exclamation-triangle"></i> This is a warning message.</span>
    </div>

    <div class="inputWrapper">
      <input class="input input--success" type="text" name="input" value="" placeholder="Last Name*" required>
      <label class="label" for="input">Last Name</label> 
      <span class="info info--isVisible info--success"><i class="fa fa-check-circle"></i> This is a success message.</span>
    </div>

    <div class="inputWrapper">
      <input class="input" type="text" name="input" value="" placeholder="Password*" required>
      <label class="label" for="input">Password</label> 
      <span class="info info--isVisible">Must contain at least one number and one uppercase and lowercase letter, and at least 10 or more characters.</span>
    </div>

    <div class="inputWrapper inputWrapper--double">
      <textarea class="input" name="textarea" id="textarea" cols="30" rows="10" contentEditable="true" placeholder="Your Message" required></textarea>
      <label class="label" for="input">Your Message</label>
      <span class="info">Please add a Message</span> 
    </div>
  </form>
</div>

<div class="container container--on-dark">
  <form>
    <div class="inputWrapper">
      <input class="input" type="text" name="firstname" value="" placeholder="First Name">
      <label class="label" for="input">First Name</label>
      <span class="info"><i class="fa fa-info-circle"></i> Please add your first name.</span>
    </div>

    <div class="inputWrapper">
      <input class="input" type="text" name="lastname" value="" placeholder="Last Name*" required>
      <label class="label" for="input">Last Name</label> 
      <span class="info"><i class="fa fa-info-circle"></i> Please add your last name.</span>
    </div>

    <div class="inputWrapper">
      <input class="input input--error" type="text" name="input" value="" placeholder="First Name*" required>
      <label class="label" for="input">First Name</label>
      <span class="info info--isVisible info--error"><i class="fa fa-info-circle"></i> This is an error message.</span>
    </div>

    <div class="inputWrapper">
      <input class="input input--warning" type="text" name="input" value="" placeholder="Account Number*" required>
      <label class="label" for="input">Account Number</label>
      <span class="info info--isVisible info--warning"><i class="fa fa-exclamation-triangle"></i> This is a warning message.</span>
    </div>

    <div class="inputWrapper">
      <input class="input input--success" type="text" name="input" value="" placeholder="Last Name*" required>
      <label class="label" for="input">Last Name</label> 
      <span class="info info--isVisible info--success"><i class="fa fa-check-circle"></i> This is a success message.</span>
    </div>

    <div class="inputWrapper">
      <input class="input" type="text" name="input" value="" placeholder="Password*" required>
      <label class="label" for="input">Password</label> 
      <span class="info info--isVisible">Must contain at least one number and one uppercase and lowercase letter, and at least 10 or more characters.</span>
    </div>

    <div class="inputWrapper inputWrapper--double">
      <textarea class="input" name="textarea" id="textarea" cols="30" rows="10" contentEditable="true" placeholder="Your Message" required></textarea>
      <label class="label" for="input">Your Message</label>
      <span class="info">Please add a Message</span> 
    </div>
  </form>
</div>
              
            
!

CSS

              
                $error        = #F02917
$success      = #34CA77
$warning      = #AE8E35

::placeholder
  color: #999
  transition: color .25s ease
  
input, 
textarea
  width: 100%
  height: 40px
  line-height: 1
  border: 1px solid #D7D8E0
  border-radius: 3px
  padding: 0 .75rem 0 .75rem
  font-size: 14px
  line-height: 40px
  position: relative
  appearance: none
  
  &:focus, &:not(:placeholder-shown)
    outline: 0
    border: 1px solid #eee
    border-color: #49B8F1
    background-color: transparent
    
    .container--on-dark & 
      background-color: white
    
    &::placeholder
      color: transparent
    
    &:focus, &:not(:placeholder-shown)
      ~ label
        transition: transform .25s ease-out, opacity .25s ease-out, background-color .25s ease-out
        transform: translateY(-10px)
        opacity: 1
        background-color: white
    
    &:required
      ~ label
        &::after
          content: ' *'
          color: red
          
  &:valid:not(:focus)
    border-color: #D7D8E0
    
.input
  transition: border-color .25s ease-out, opacity .25s ease-out, background-color .25s ease-out
  
  &--error
    border-color: #E9AAAB
    background-color: #F8F3F2
    
    &::placeholder
      color: $error
    
  &--warning
    border-color: #E0D19D
    background-color: #FCFAF2
    
    &::placeholder
      color: $warning
    
  &--success
    border-color: #67E7A0
    background-color: #F8FCFA
    
    &::placeholder
      color: $success
          
label
  position: absolute
  left: .75rem
  padding: 3px 4px
  top: 0
  background-color: transparent
  transition: transform 0 ease-out
  backface-visibility: hidden
  border-radius: 4px 4px 0 0
  pointer-events: none  
  font-size: 10px
  color: #232323
  font-weight: 600
  letter-spacing: 1px
  opacity: 0
  transform: translateY(0)
  
.info
  pointer-events: none
  width: 100%
  font-size: 14px
  color: #999
  padding: .25rem .25rem 0 .25rem
  display: none
  
  &--isVisible 
    display: block
  
  &--error 
    color: $error
    
  &--warning
    color: $warning
  
  &--success
    color: $success
    
textarea
  resize: vertical
  min-height: 100px
  line-height: 1.5
  padding: .75rem 1rem
  
.inputWrapper
  width: 100%
  max-width: 300px
  position: relative
  margin-top: 1.5rem
  
  &--double
    max-width: 500px
  
body
  padding: 0
  font-size: 14px
  color: #232323
  line-height: 1.5
  display: flex
  
.container
  flex: 1
  height: 100%
  min-height: 100vh
  padding: 1rem
  
  &--on-dark 
    background-color: #232323
    
form
  max-width: 300px
  margin: 0 auto
  
*
  box-sizing: border-box
  
  
// change webkit autofill-color. not the best UX but could help with our placeholders.
input:-webkit-autofill
  border-color: darken(#FAFFBD, 50%)
  
  ~ label
    box-shadow: 0 -10px 0 0 #FAFFBD inset
              
            
!

JS

              
                
              
            
!
999px

Console