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

              
                <div class="wrapper">
  <h1>Letter-like form with inline fields</h1>
  
  <form class="form__contact" action="">
    <fieldset>
      <p>Hey, Stranger!</p>
      <p>My name is <span class="form__field field--name" data-placeholder="your name" tabindex="1" contenteditable></span> and I'm writting tou you since I'm interested in <span class="form__field field--message" data-placeholder="your message" tabindex="2" contenteditable></span>.</p>
      <p>This is my <span class="form__field field--email" data-placeholder="email address" tabindex="3" contenteditable></span>.</p>
      <p>Hope to get in touch soon. Cheers!</p>
      <button type="submit" class="button button--xlarge" tabindex="4">Send message &#187;</button>
    </fieldset>
  </form>
</div>

<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
  <defs>
    <filter id="blur0">
      <feGaussianBlur in="SourceGraphic" stdDeviation="0 0" />
    </filter>
    <filter id="blur1">
      <feGaussianBlur in="SourceGraphic" stdDeviation="0 5" />
    </filter>
    <filter id="blur2">
      <feGaussianBlur in="SourceGraphic" stdDeviation="0 10" />
    </filter>
    <filter id="blur3">
      <feGaussianBlur in="SourceGraphic" stdDeviation="0 15" />
    </filter>
    <filter id="blur4">
      <feGaussianBlur in="SourceGraphic" stdDeviation="0 20" />
    </filter>
  </defs>
</svg>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Roboto+Slab:400');
@import url('https://fonts.googleapis.com/css?family=Shadows+Into+Light');

$line-height: 40px;

::selection { 
  color: #fff;
  background: #9FBE5A;  
}

body {
  width: 100vw;
  height: 100%; 
  padding-bottom: 50px;
  overflow-x: hidden; 
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #16a085, #f4d03f);
}

h1 {
  margin-bottom: 75px;
  padding: 0 20vw;
  font: 400 56px 'Roboto Slab', serif;
  font-size: 56px;
  text-align: center;
  color: #fff;
}

// Form tag holds the torn paper border
.form__contact {
  max-width: 600px;
  margin: 0 auto;
  border-left: 30px solid white; 
  border-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI0MS44NnB4IiBoZWlnaHQ9IjUyLjMyNnB4IiB2aWV3Qm94PSIwIDAgNDEuODYgNTIuMzI2IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA0MS44NiA1Mi4zMjYiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0wLDB2MjUuMTYzaDcuMDk3YzAuNTAxLTQuOTg5LDQuNzEyLTguODg0LDkuODMzLTguODg0YzUuNDU4LDAsOS44ODQsNC40MjUsOS44ODQsOS44ODRzLTQuNDI1LDkuODg0LTkuODg0LDkuODg0Yy01LjEyMSwwLTkuMzMyLTMuODk1LTkuODMzLTguODg0SDB2MjUuMTYzaDQxLjg2VjBIMHoiLz48L3N2Zz4=) 5% 100% repeat;
  border-image-width: 0px 0px 0px 30px;
  transform: translateY(100%);
  animation: init 1s ease-in-out forwards;
  
  fieldset {
    position: relative;
    margin: 0;
    padding: 30px 30px $line-height 80px;
    border: none;
    border-radius: 0 20px 20px 0;
    font: 24px 'Shadows Into Light', cursive;
    background: #fff linear-gradient(rgba(0,0,0,.1) 1px, transparent 0) 0 20px / 100% $line-height;
    
    &:after {
      position: absolute; 
      top: 0;
      left: 50px;
      content: '';
      height: 100%;
      width: 1px;
      border-left: double #E08183;
    }
  } 
  
	p {
    margin: 0 0 $line-height 0;
    line-height: $line-height;
    color: #333;
	}

	span {
		position: relative;
		line-height: $line-height;
	}

	button {
		margin-top: $line-height;
    float: right;
    border: none;
    font-family: 'Shadows Into Light', cursive;
    color: #E08183;
    background: transparent;
    cursor: pointer;
    transition: transform 0.25s ease;
    
    &:hover {
      transform: translateX(10px)
    }
	}
}

.form__field {
  display: inline;
  color: #7DB665;
  outline: none;

  &:empty {
    display: inline-block;
    color: #DDD;
  }
  
  // Use a data-attr to replicate a placeholder
  &:empty,
  &:empty:focus {
    &:before {
      content: attr(data-placeholder);
    }
  }
}

// Hide blur defs
svg {
  display: none;
}

@keyframes init {
  75% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes do-blur {
  0% {
    filter: url(#blur4);
  }
  
  25% {
    filter: url(#blur3);
  }
  
  50% {
    filter: url(#blur2);
  }
  
  75% {
    filter: url(#blur1);
  }
  
  100% {
    filter: url(#blur0); 
  }
}



              
            
!

JS

              
                // Nope, no JS required :)
              
            
!
999px

Console