Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="form_wrap"> 
  <h2>Input Placeholder float to top example</h2>
  <div class="input_wrap">
    <input type="text" required />
    <label>Your Name</label>

  </div>
</div>


              
            
!

CSS

              
                /* Page styles */

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

h2 {font-family:arial; color:#afbdcf; text-transform:uppercase; font-size:16px; font-weight:normal;
  margin-bottom:20px;
  width:500px; height:50px; background:#F1F2F4;  
  position:absolute; top:0px; left:0px;margin: 0px;
  padding: 18px;
  text-align: center;
}
body {
  background: url(http://andrahand.com/img/back1.jpg) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}


.form_wrap {
  height: 300px;
  width: 500px;
  background: white;
  margin: 50px auto;
  padding: 125px 0px 0px 100px;
  outline: 5px solid rgba(0,0,0,0.1);
  position:relative;
}


/* Input form Style */

input[type="text"] {
  border: 2px solid #afbdcf;
  border-radius: 5px;
  height: 47px;
  width:300px;
  color: #000000;
  font-size: 14px;
  padding-left: 20px;
  box-shadow: none;  
}

/* Label style after Input feild is in focus. Can also use input:focus ~ label to select sibling. */

input:focus + label, input:valid + label{
  font-size: 12px;
  color: #afbdcf;
  top: -5px;
  left:10px;
  background: #ffffff;
  padding: 0px 5px 0px 5px;
}

.input_wrap {width:auto; height:auto; position:relative;
}

.input_wrap label {
  font-family:arial;
  font-size:16px;
  color: #afbdcf;
  padding: 14px;
  position: absolute;
  top: 0;
  left: 0;
  transition:0.2s ease all; 
  -moz-transition:0.2s ease all; 
  -webkit-transition:0.2s ease all;
  pointer-events: none;

}

input[type="text"]:focus {outline:none;}











              
            
!

JS

              
                
              
            
!
999px

Console