<div class="row">
  <span>
    <input class="slider" id="name" type="text" />
    <label for="name">Name</label>
  </span>
  <span>
    <input class="slider" id="phone" type="text" />
    <label for="phone">Phone</label>
  </span>
  <span>
    <input class="slider" id="email" type="text" />
    <label for="email">Email</label>
  </span>
  <span>
    <input class="slider" id="msg" type="textarea" />
    <label for="msg">Message</label>
  </span>
  <span>
    <input type="submit" id="submit"/>
  </span>
  

</div>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300);

html,
body {
  font-family: "Open Sans", sans;
  color: #fff;
  background: #8BB9C9;
  font-size: 1.2em;
}
.row {
  width: 300px;
  margin: 0 auto;
  padding-top: 20px;
}
.row span {
  position: relative;
  display: block;
  margin: 20px 10px;
}

#submit {
  background: #72A08B;
  color: #fff;
  font-family: "Open Sans", sans;
  font-size: 1em;
  width: 325px;
  padding: 10px 40px;
  border: 0;
  outline: 0;  
  transition: all .3s ease-in-out;
  -webkit-transition: all .3s ease-in-out;
}
#submit:hover {
  background: #0BA393;
}
.slider {
  display: inline-block;
  width: 280px;
  padding: 10px 5px 10px 40px;
  font-family: "Open Sans", sans;
  font-size: 1em;
  color: #1d1d1d;
  background: #9EE69F;
  border: 0;
  outline: 0;
  text-indent: 60px;
  transition: all .3s ease-in-out;
  -webkit-transition: all .3s ease-in-out;
}
#msg {
  width: 260px;
  height: 250px;
  padding: 13px 5px 10px 60px;
  resize: none;
}
#msg + label {
  top: 26px;
}
.slider + label {
  display: inline-block;
  position: absolute;
  margin-top: -23px;
  top: 50%;
  left: 0;
  min-width: 80px;
  padding: 7px 10px;
  color: #0BA393;
  transition: all .3s ease-in-out;
  -webkit-transition: all .3s ease-in-out;
  background: rgba(219,106,160, 0);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.slider + label:after {
  position: absolute;
  content: "";
  width: 0;
  height: 0px;
  top: 50%;
  right: -18px;
  margin-top: -9px;
  border: 10px solid transparent;
  border-left: 10px solid rgba(11,163,147, 0);
  transition: all .3s ease-in-out;
  -webkit-transition: all .3s ease-in-out;
}

.slider:focus,
.slider:active {
  color: #1d1d1d;
  text-indent: 0;
  background: #9EE69F;
}

.slider:focus + label,
.slider:active + label {
  color: #fff;
  background: #0BA393;
  transform: translateX(-100px);
  -webkit-transform: translateX(-100px);
}
#msg:focus + label,
#msg:active + label {
  color: #fff;
  background: #0BA393;
  transform: translateX(-112px);
  -webkit-transform: translateX(-112px);
}
.slider:focus + label:after,
.slider:active + label:after {
  border-left: 9px solid #0BA393;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.