Pen Settings



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


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


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.


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.


                <div class="page">

    <header class="header-base" role="banner">
      <div class="content">
          Display Label on Focus

    <main class="main-base" role="main">
      <form class="content">
      <div class="form-row">
        <input type="text" class="input-text" id="input" placeholder="Your Name" />
        <label class="label-helper" for="input">Name</label>

      <div class="form-row" >
        <input type="email" class="input-text" id="input2" placeholder="Your Email" />
        <label class="label-helper" for="input2">Your Email</label>

      <div class="form-row" >
        <input type="password" class="input-text" id="input3" placeholder="Your Password" />
        <label class="label-helper" for="input3">Your Password</label>
      </form> <!-- end .content -->

  </div> <!-- end .page -->

<p class="p">Demo by Scott O'Hara. <a href="">See article</a>.</p>


                *, *:after, *:before {
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
      font-family: arial;
.form-row {
  margin-bottom: 20px;
  padding: 4px 0;
  position: relative; }
.form-block {
  border: 1px solid #cccccc;
  margin-bottom: 8px;
  padding: 8px 12px; }

.input-text {
  background-color: white;
  -webkit-appearance: none;
  border: 1px solid #cccccc;
  font-family: Arial;
  margin-bottom: 8px;
  padding: 8px 4px;
  position: relative;
  width: 100%;
  z-index: 3; }
  .input-text:focus {
    box-shadow: 0 0 6px rgba(0, 200, 222, 0.25);
    background-color: #fafafa; }

.label-helper {
  position: absolute;
  opacity: 0;
  transition: .2s bottom, .2s opacity;
  bottom: 0;
  left: 0;
  z-index: 1; }

.input-text:focus + .label-helper, .input-text:invalid + .label-helper {
  bottom: 95%;
  font-family: arial;
  font-size: 14px;
  line-height: 1;
  opacity: 1;
  padding: 4px; }
.input-text:invalid {
  border-left: 10px solid #f00; }
  .input-text:invalid + .label-helper::after {
    color: #f00;
    content: "X";
    font-family: arial;
    font-size: 14px;
    line-height: 1;
    padding-left: 12px; }

.p {
  text-align: center;
  padding-top: 50px;