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 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

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="subscribe">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="200" height="200"
viewBox="0 0 191 191"
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="none" stroke-linecap="none" stroke-linejoin="none" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,191.98828v-191.98828h191.98828v191.98828z" fill="none" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter"></path><g id="Layer_1"><path d="M170.10938,73.11719v-37.30469c0,-4.17813 -3.28281,-7.46094 -7.46094,-7.46094h-126.83594c-4.17813,0 -7.46094,3.28281 -7.46094,7.46094v37.30469l70.87891,59.6875z" fill="#ffffff" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter"></path><path d="M170.10938,73.11719v-37.30469c0,-4.17813 -3.28281,-7.46094 -7.46094,-7.46094h-96.99219h-29.84375c-4.17813,0 -7.46094,3.28281 -7.46094,7.46094v7.46094v13.42969" fill="none" stroke="#34495e" stroke-width="8.95313" stroke-linecap="round" stroke-linejoin="round"></path><path d="M162.64844,170.10938h-126.83594c-4.17813,0 -7.46094,-3.28281 -7.46094,-7.46094v-89.53125l70.87891,59.6875l70.87891,-59.6875v89.53125c0,4.17812 -3.28281,7.46094 -7.46094,7.46094z" fill="#bfc1ca" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter"></path><path d="M128.47734,108.18359l41.63203,57.3l-54.16641,-46.70547z" fill="#9596a6" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter"></path><path d="M49.24219,149.21875l39.69219,-36.85703c5.81953,-5.37187 14.62344,-5.22266 20.44297,0.14922l56.10625,52.97266" fill="#bfc1ca" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter"></path><path d="M170.10938,162.64844l-14.92187,-7.46094h-89.53125c-4.17812,0 -7.46094,3.28281 -7.46094,7.46094v0c0,4.17812 3.28281,7.46094 7.46094,7.46094h96.99219c4.17812,0 7.46094,-3.28281 7.46094,-7.46094z" fill="#9596a6" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter"></path><path d="M49.24219,149.21875l39.69219,-36.85703c5.81953,-5.37187 14.62344,-5.22266 20.44297,0.14922l56.10625,52.97266" fill="none" stroke="#34495e" stroke-width="8.95313" stroke-linecap="round" stroke-linejoin="round"></path><path d="M115.94297,118.77812l54.16641,-45.66094v89.53125c0,4.17812 -3.28281,7.46094 -7.46094,7.46094h-126.83594c-4.17813,0 -7.46094,-3.28281 -7.46094,-7.46094v-89.53125l42.975,36.26016" fill="none" stroke="#34495e" stroke-width="8.95313" stroke-linecap="round" stroke-linejoin="round"></path></g></g></svg>
  <h1>SUBSCRIBE</h1>
  <span>Subscribe to our newsletter & stay updated</span>
</div>
<div class="register">
  <div class="field">
   
<form action="https://Your_Username.us19.list-manage.com/subscribe/post?u=c8a5a922b296ff21303608394&amp;id=Your_ID" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <input id="register" maxlength="21" type="text" /><label for="register"><span> Em@il Address </span></label><button><i class="fa fa-paper-plane"></i></button>
  </form>
  </div>
</div>
<p>
 <a href="#" target="_blank"><i class="fa fa-chevron-left"></i> BACK TO HOMEPAGE</a>
</p>


              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Nunito:300,500,700&display=swap");
html,
body {
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

*,
*:before,
*:after {
  box-sizing: border-box;
  outline: none;
}

body {
  background: #426fff;
  font-family: 'Nunito', sans-serif;
  background-size: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}
.subscribe {
  margin-top: 50px;
  text-align: center;
  font-size: 2em;
  color: #FFF;
  letter-spacing: 2px;
  line-height: 23px;
}
p {
  margin-top: 50px;
  text-align: center;
  color: #ffffff;
  font-size: 13px;
}

a:hover, a:visited, a:hover, a:link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.register {
  margin: 6em auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  }
span {
  text-align: center!important;
  font-size: 1em;
}

.field {
  width: 800px;
  height: 70px;
  position: relative;
}
.field input {
  width: 100%;
  border-radius: 6px;
  height: 90px;
  border: 0;
  padding: 20px;
  padding: 20px 0 0 16px;
  font-size: 0;
  background: #1566BB;
  transition: background .3s ease;
  color: #ffffff;
  
}
.field input:focus {
  background: #065CB7;
  font-size: 24px;
}
.field input:focus::-moz-selection {
  background: rgba(188, 232, 255, 0.5);
}
.field input:focus::selection {
  background: rgba(188, 232, 255, 0.5);
}
.field input.active {
  background: #065CB7;
  font-size: 24px;
}

.field input,
.field button {
  position: absolute;
  height: 90px;
}
.field button {
  content: '';
  background: rgba(0, 0, 0, 0.3);
  right: 0;
  border: 0;
  width: 120px;
  -webkit-border-top-right-radius: 6px;
  -webkit-border-bottom-right-radius: 6px;
  -moz-border-radius-topright: 6px;
  -moz-border-radius-bottomright: 6px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  font-size: 2.7em;
  cursor: pointer;
  transition: width .3s ease, background .3s ease, opacity .3s ease;
  opacity: 0;
  color: #065CB7;
  text-transform: uppercase;
  pointer-events: none;
}
.field button.active {
  color: #ffffff;
  background: #639EDB;
  opacity: 1;
  pointer-events: auto;
}
.field button.active:hover {
  background: #538ed8;
}
.field button.full {
  width: 100%;
}
.field input:focus + label {
  font-size: 22px;
  -webkit-transform: translate(16px, 11px);
          transform: translate(16px, 11px);
  color: rgba(255, 255, 255, 0.7);
}
.field label {
  position: absolute;
  color: white;
  -webkit-transform: translate(170%, 50%);
          transform: translate(170%, 50%);
  transition: font-size .3s ease, color .3s .1s ease, -webkit-transform .3s ease;
  transition: transform .3s ease, font-size .3s ease, color .3s .1s ease;
  transition: transform .3s ease, font-size .3s ease, color .3s .1s ease, -webkit-transform .3s ease;
  font-size: 1.2em;
  font-weight: 700;
  line-height: 2.3;
  text-transform: uppercase;
  letter-spacing: 2px;
  word-spacing: 0.2em;
  
}
.field label.active {
  font-size: 22px;
  -webkit-transform: translate(16px, 11px);
          transform: translate(16px, 11px);
  color: rgba(21,112,208, 0.5);
}
.field input:focus + label + button {
  opacity: 1;
}

/* Change Autocomplete styles in Chrome*/
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  
  -webkit-text-fill-color: white;
  -webkit-box-shadow: 0 0 0px 1000px rgba(21,112,208, 0.5) inset;
  transition: background-color 5000s ease-in-out 0s;
}

@media (max-width: 768px) {
    .field {
      width:90%; 
      
  }
    .field input{
      display: block; 
      
  }
  .subscribe {
    display: block;
    width: 100%;
    margin-bottom: 5rem;
    font-size: 1.2em;
    line-height: 20px;
  }
  .field label {
  position: absolute;
  -webkit-transform: translate(110%, 70%);
          transform: translate(110%, 70%);
    font-size: 1em;
    
  }
  
    .register {
      width: 100%; 
      margin:0; 
  }
}
              
            
!

JS

              
                var $form = $('.register');

function validateEmail(email) {
	var regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
	return regex.test(email);
};

$form.on('keyup', 'input', function(e) {
	var $this = $(this),
		$input = $this.val();
	if ($input.length > 0) {
		$form.find('label').addClass('active');
		if (validateEmail($input)) {
			$form.find('button').addClass('active');
			console.log(e);
			if (e.which === 13) {
				$form.find('button').click();
				$this.blur();
			}
		} else {
			$form.find('button').removeClass('active');
		}
		$(this).addClass('active');
	} else {
		$form.find('label').removeClass('active');
		$form.find('button').removeClass('active');
		$(this).removeClass('active');
	}
});

$form.on('click', 'button.active', function(e) {
	e.preventDefault;
	var $this = $(this);
	$(this).addClass('full');
	$(this).html('Thanks!');

	setTimeout(()=> {
		$form.find('input').val('').removeClass('active');
		$form.find('label').removeClass('active');
		$this.removeClass('full active');
		$this.html('<i class="fa fa-paper-plane"></i>');
	}, 1200);
})
              
            
!
999px

Console