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

              
                <div class="contact">
  <div class="wrapper">
    <p class="close">Close <i class="fa fa-times-circle"></i></p>
    <p>Name:<br />
    <input type="text" /></p>
    <p>Email:<br />
    <input type="email" /></p>
    <p>Subject:<br />
    <input type="text" /></p>
    <p>Message:<br />
    <textarea></textarea></p>
    <p><input id="submit" type="submit" value="Send" /></p>
    <p class="thanks">Thank you, we'll be in touch soon.</p>
  </div>
</div>

<div class="topbar">
  <div class="wrapper">
    My Site <span id="open-form" class="open">Contact <i class="fa fa-envelope"></i></span>
  </div>
</div>
<div class="wrapper page">
  <h1><i class="fa fa-pencil"></i> Drop-Down Contact Form</h1>
  <p>Thank you message and close on submit.</p>

<p>Aenean at nisi ligula! Sed gravida nisi at dolor ullamcorper lacinia. Vivamus semper justo in augue sagittis, condimentum feugiat sem placerat. Donec tincidunt sapien sed congue venenatis. In laoreet dictum eros, euismod sagittis urna cursus at? Fusce ut accumsan ante. Morbi placerat dui lorem, ac tincidunt ligula blandit quis. Vivamus accumsan tincidunt nibh eget eleifend. Cras risus libero, luctus nec ultricies eu, molestie a tortor. Nullam molestie pharetra mi, sit amet accumsan enim luctus quis. Pellentesque metus est, eleifend non iaculis et, varius in enim.</p>

<p>Curabitur consequat neque id mollis tristique. Nunc efficitur tellus at metus malesuada pellentesque. Ut et venenatis leo! Quisque vel diam bibendum, semper risus eu, pharetra erat. Fusce id libero elementum, consectetur orci eget; rhoncus est. Sed et mattis diam. Proin aliquam tincidunt diam, et sodales dolor ullamcorper et. Sed in est pretium, sodales dui id, auctor ligula. Duis posuere, urna non fermentum consectetur, erat lacus tempus dolor, a feugiat nisi nisl ac elit? Sed sit amet enim non ipsum malesuada gravida! Duis ullamcorper ornare ligula vestibulum malesuada. Donec quis nisl sed turpis blandit consectetur. Nullam dictum purus vitae mattis tincidunt!</p>

<p>Integer ut orci dignissim, elementum dui quis, blandit leo. Curabitur ultrices nisl ac ullamcorper tempus. Vivamus accumsan tincidunt felis sed vulputate. Sed cursus purus quis lectus interdum tincidunt. Duis tristique fringilla consequat. Phasellus auctor cursus felis, ut volutpat tellus tincidunt in. Nunc vulputate molestie neque, sit amet facilisis velit efficitur vitae. Mauris magna est, cursus nec mi a, placerat venenatis ante. Nam in feugiat neque. Praesent condimentum ex at purus luctus porta. Vivamus consectetur posuere leo at auctor. Vestibulum sed rutrum est, sit amet convallis libero! Fusce consectetur blandit ex, sit amet eleifend lectus tempus et. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>

<p>Morbi pharetra metus vel euismod ultricies. Maecenas pretium arcu ut enim porta bibendum. Etiam lacus libero, mollis quis tortor eu, hendrerit semper diam. Suspendisse sed dolor sed metus porta scelerisque eget quis enim. Suspendisse potenti. Pellentesque at sollicitudin nulla. Morbi finibus urna risus. Nullam commodo auctor dui eu pulvinar. Vivamus tincidunt; nisi ut sodales pretium, ipsum magna cursus dui, a feugiat ipsum mi id massa.</p>

<p>Quisque tellus ligula, porttitor in velit quis, porttitor dignissim risus. Nam aliquam gravida massa, sit amet auctor augue faucibus nec! Suspendisse et augue posuere; tincidunt magna sed, iaculis lorem. Sed non maximus elit, non vulputate justo. Nam erat diam, egestas vel laoreet eget; euismod quis tortor. Etiam vel felis fringilla, tincidunt sapien eu, scelerisque dolor. Pellentesque sit amet tortor quis sapien hendrerit vestibulum? Etiam mollis ullamcorper scelerisque.</p>
</div>
              
            
!

CSS

              
                body {
  position: relative;
  background: #f0eace;
	color: #4b3b35;
	font-family: 'Open Sans', arial, sans-serif;
  font-size: 1.4em;
  line-height: 1.4em;
}

h1 {
  font-family: 'Patua One', serif;
  font-size: 2em;
  margin-bottom: .8em;
}

.fa {z-index: 10;}

p {margin-bottom: 1.2em;}

.wrapper {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1em;
  
  &.page {padding: 4em 1em;
    p:first-of-type {font-weight: 700;}
  }
}

.contact {
  position: absolute;
  z-index: 20;
  top: 60px;
  left: 0;
  right: 0;
  padding: 2em;
  background: #5d5550;
  color: #ede6bd;
  transition: all .4s;
  transform: translateY(-100%);
  
  &.open-form {
    transform: translateY(0);
  }
  
  p {font-weight: 600;
    
    &.close {
      text-align: right;
      cursor: pointer;
    }
    
    &.thanks {
      opacity: 0;
      transition: opacity .2s;
    }
    
    &.thanks.visible {opacity: 1;}
  }
  
  input, textarea {
    width: 100%;
    background: #f0edde;
    border: #4b3b35 solid 2px;
    border-radius: .5em;
    resize: none;
    padding: .7em 1em;
    color: #5d5550;
    font-family: 'Open Sans', arial, sans-serif;
    font-size: .65em;
    font-weight: 600;
  }
  
  textarea {
    font-size: .6em;
    height: 20em;
  }
  
  input[type="submit"] {
    width: auto;
    font-size: .8em;
    font-weight: 900;
    cursor: pointer;
  }
}

.topbar {
  z-index: 30;
  position: fixed;
  top: 0;
  width: 100%;
  background: #4b3b35;
  color: #ede6bd;
  font-weight: 900;
  height: 60px;
  line-height: 60px;
    
   span {
     float: right;
     font-weight: 600;
     
     &.open {cursor: pointer;}
     
   }
}
              
            
!

JS

              
                $(function() {
$("#open-form").click(function(){ 
  $(".contact").addClass("open-form");
});
});

$(function() {
$("#submit").click(function(){ 
  setTimeout('jQuery(".contact").removeClass("open-form")', 3000);
  setTimeout('jQuery(".thanks").removeClass("visible")', 3000);
});
});

$(function() {
$("#submit").click(function(){ 
  $(".thanks").addClass("visible");
});
});

$(function() {
$(".close").click(function(){ 
  $(".contact").removeClass("open-form");
});
});
              
            
!
999px

Console