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

              
                <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,800' rel='stylesheet' type='text/css'>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

<form action="" method="post">
  <div class="form-content">
    <h1>Shoot me some mail <i class="fa fa-inbox"></i></h1>
    <label for="Name">Name:</label>
    <input type="text" name="Name" placeholder="Name..."><br>
    <div class="email-box">
    <label for="email">Email:</label>
    <input type="text" name="email" class="email" placeholder="Email..." required><br>
        <div class="good-email">
          <i class="fa fa-check-square"></i>
        </div>
        <div class="bad-email">
          <i class="fa fa-exclamation-circle"></i>
        </div>
    </div>
    <label for="textarea">Message:</label>
     <textarea rows="6" name="textarea" value="Mouse" placeholder="Your message here..." required></textarea><br>
    <button type="submit"><span class="hidden">Put it in my inbox</span> <i class="fa fa-envelope-o"></i></button>
  </div>
</form> 



              
            
!

CSS

              
                body {
  font-family: 'Open Sans', sans-serif;
  
}

h1 {
  color:#7F6431;
  margin-top: 0;
}

placeholder,
input,
textarea,
button {
 font-family: 'Open Sans', sans-serif;
 font-size:16px;
 margin-top: 10px;
 padding-top:5px;
 padding-bottom:5px;
 padding-left:5px;
 padding-right:5px;
 background-color:#56B281;
 color:#FFF;

}

form {
  width:100%;
  max-width:800px;
  margin-left:auto;
  margin-right:auto;
}

.form-content {
  padding-top:20px;
  margin-left:auto;
  margin-right:auto;
  width:70%;
  position:relative;
}

input {
  width:100%;
  margin-left:auto;
  margin-right:auto;
  border:none;
}

button {
  background:#A270BF;
  border:none;
  padding-left:20px;
  padding-right:20px;
  color:#FFF;
  display:inline-block;
  margin-left:auto;
  margin-right:auto;
  margin-top:25px;
  border-radius:20px;
}

.fa-dot-circle-o {
  font-size:16px;
}

textarea {
  width:100%;
  margin-left:auto;
  margin-right:auto;
  border:none;
}

label {
  display:none;
}

::-webkit-input-placeholder {
   color: #FFF;
}

:-moz-placeholder { /* Firefox 18- */
   color: #FFF;  
}

::-moz-placeholder {  /* Firefox 19+ */
   color: #FFF;  
}

:-ms-input-placeholder {  
   color: #FFF;  
}

input:focus, textarea:focus, button:focus {
  outline: none;
  border-color:#FFCC6F;
  box-shadow: 0 1px 1px #FFCC6F inset, 0 0 8px #FFCC6F;
  
 }
  
.error {
  background:#BF3632;
}

.valid {
 background-color:#56B281;
}

button:hover {
  background:#77528C;
}

.email-box {
  position:relative;
  display:inline-block;
  width:100%;
}

.good-email {
  position:absolute;
  left:105%;
  bottom:20%;
  color: #56B281;
  display:none;
}

.bad-email {
  position:absolute;
  left:105%;
  bottom:20%;
  color: #BF3632;
  display:none;
}

.hidden {
  display:none;
}

.fa-envelope-o {
  font-size:36px;
}
              
            
!

JS

              
                //Chalker's email validation plugin

(function( $ ) {
  $.fn.validEmail = function(options) {
  	options = options || {};
  	var on = options.on;
  	var success = options.success || (function(){});
  	var failure = options.failure || (function(){});
  	var testInitially = options.testInitially || false;

  	var $input = $(this);

  	function check($input) {
  		if($input.is("input,textarea")) {
  			var emailRegExp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
  			return emailRegExp.test($input.val());
  		} else {
  			return false;
	  	}

  	}

  	function applyCode($input) {
  		check($input) ? success.call($input.get(0)) : failure.call($input.get(0));
  	}
	
  	if (typeof on === "string")
  		$input.bind(on, function() { applyCode($(this)); });

  	if (testInitially) $input.each(function() { applyCode($(this)); });
  	return check($input);

  };
})( jQuery );

//code...


$("input.email").validEmail({on:"blur", success:function(){
    $(this).removeClass("error").addClass("valid");  
    $( ".good-email" ).show();
    $( ".bad-email" ).hide(); 
}, failure:function(){
    $(this).removeClass("valid").addClass("error");
    $( ".bad-email" ).show();
    $( ".good-email" ).hide();
}});







              
            
!
999px

Console