"Contact form improved"
Bootstrap 4.1.1 Snippet by Reason706

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row d-flex justify-content-center"> <div class="col-md-8 contact-form-wrapper"> <h2 class="text-center">Contact Us</h2> <h3>Get in touch</h3> <form > <div class="form-group"> <input type="text" class=" form-input" id="name" aria-describedby="nameHelp" placeholder="Enter Name" required> <label for="name" class="form-label">Name</label> </div> <div class="form-group"> <label for="exampleInputEmail1">Email address</label> <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email"> <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> </div> <div class="form-group"> <label for="exampleInputPassword1">Password</label> <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password"> </div> <div class="form-group form-check"> <input type="checkbox" class="form-check-input" id="exampleCheck1"> <label class="form-check-label" for="exampleCheck1">Check me out</label> </div> <button type="submit" class="btn btn-primary">Submit</button> </form> </div> </div> </div>
.contact-form-wrapper{ background:red; } .form-group { display: flex; flex-flow: column-reverse; } .form-group:not(:last-child) { margin-bottom: 2rem; } .form-input{ font-size: 1.5rem; font-family: inherit; color: inherit; padding: 0.5rem 2rem; border-radius: 2px; background-color: rgba(255, 255, 255, 0.5); border: none; border-bottom: 3px solid transparent; width: 90%; display: block; transition: all .3s; } .form-input:focus { outline: none; box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1); border-bottom: 3px solid red !important; } .form-input:focus:valid { border-bottom: 3px solid #4CAF50 !important; } .form-input::-webkit-input-placeholder { color: #B0BEC5; } .form-label { font-size: 1.2rem; font-weight: 500; margin-left: 2rem; display: block; transition: all .3s; } .form-input:placeholder-shown + .form-label { opacity: 0; visibility: hidden; transform: translateY(2rem); }

Related: See More


Questions / Comments: