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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <!--
https://dribbble.com/shots/2197140-New-Material-Text-Fields
-->

<div class="form">
  <label class="lblInp m-btm-40" for="mail">
    <input type="email" id="mail" required></input>
    <label for="mail">Mail</label>
    <i class="fa fa-envelope" aria-hidden="true"></i>
  </label>
  <label class="lblInp" for="password">
    <input type="password" id="password"></input>
    <label for="password">Password</label>
    <i class="fa fa-lock" aria-hidden="true"></i>
  </label>
</div>
            
          
!

CSS

            
              body
  background #3F51B5
  font-family 'Lato', sans-serif
  
*
  box-sizing border-box
  
.form
  width 100%
  max-width 290px
  margin 0 auto
  padding-top 60px
  
.lblInp
  position relative
  display block
  height 48px
  cursor text
  
.lblInp input
  position absolute
  bottom 0
  width 100%
  height 2px
  padding-left 32px
  border 0
  border-radius 2px
  box-shadow 0 2px 8px rgba(#000,.3)
  transition all .3s ease
  vertical-align bottom
  font-size 16px
  &:focus
  &.filled
    height 100%
    outline none
    + label
      position absolute
      transform translateY(-34px)
      font-size 12px
      color rgba(white,.6)
    + label + i
      transform translateY(0px)
      visibility visible
      transition transform .3s ease
  +label
    color white
    line-height 48px
    padding-left 3px
    transform translateY(0)
    transition all .3s ease
    pointer-events none
    & + i
      position absolute
      display block
      visibility hidden
      left 10px
      transform translateY(10px)
      color #ddd
      z-index 1
      
.fa-envelope
  font-size 14px
  top 17px

.fa-lock
  font-size 18px
  top 16px
  
.m-btm-40
  margin-bottom 40px
            
          
!

JS

            
              $('.lblInp input').keyup(function() {
  if($(this).val().length > 0){
    $(this).closest('.lblInp input').addClass('filled');
  }
  else{
    $(this).closest('.lblInp input').removeClass('filled');
  }
});
            
          
!
999px

Console