<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row centered-form">
<div class="col-xs-12 col-sm-8 col-md-4 col-sm-offset-2 col-md-offset-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Please sign up for Bootsnipp <small>It's free!</small></h3>
</div>
<div class="panel-body">
<form role="form">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<input type="text" name="first_name" id="first_name" class="form-control input-sm" placeholder="First Name" required data-toggle="floatLabel" data-value="no-js">
<label for="first_name">First Name</label>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<input type="text" name="last_name" id="last_name" class="form-control input-sm" placeholder="Last Name" data-toggle="floatLabel" data-value="no-js">
<label for="last_name">Last Name</label>
</div>
</div>
</div>
<div class="form-group">
<input type="email" name="email" id="email" class="form-control input-sm" placeholder="Email Address">
</div>
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<input type="password" name="password" id="password" class="form-control input-sm" placeholder="Password">
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<input type="password" name="password_confirmation" id="password_confirmation" class="form-control input-sm" placeholder="Confirm Password">
</div>
</div>
</div>
<input type="submit" value="Register" class="btn btn-info btn-block">
</form>
</div>
</div>
</div>
</div>
</div>
body{
background-color: #525252;
}
.centered-form{
margin-top: 60px;
}
.centered-form .panel{
background: rgba(255, 255, 255, 0.8);
box-shadow: rgba(0, 0, 0, 0.3) 20px 20px 20px;
}
/* Not Need */
@import url(http://fonts.googleapis.com/css?family=Roboto:500);
body { background-color: rgb(230, 235, 240); }
/* Basic Style */
.form-group {
position: relative;
}
.form-group [data-toggle="floatLabel"] {
height: 44px;
padding-top: 16px;
}
.form-group [data-toggle="floatLabel"] + label {
font-size: 12px;
left: 12px;
opacity: 1;
position: absolute;
top: 3px;
transition: all 0.3s ease-in-out;
}
.form-group [data-toggle="floatLabel"]:required + label {
color: rgb(255, 0, 0);
}
/* Custom Styles */
.form-group.form-group-textarea {
background-color: rgb(255, 255, 255);
border-radius: 1px;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
margin: 20px 15px ;
padding: 10px 0px 2px;
position: relative;
}
.form-group.form-group-textarea textarea {
height: 34px;
resize: none;
}
.form-group.form-group-textarea label {
color: rgb(160, 160, 160);
font-family: 'Roboto', sans-serif;
font-size: 12px;
font-weight: 500;
}
.form-group.form-group-textarea .form-control {
border-radius: 0px;
border-width: 0px;
box-shadow: none;
}
.form-group.form-group-textarea [data-toggle="floatLabel"] + label {
top: 5px;
}
/* Positioning */
.form-group [data-toggle="floatLabel"][data-value=""] {
padding-top: 6px;
}
.form-group [data-toggle="floatLabel"][data-value=""] + label {
opacity: 0;
top: 18px;
}
$(document).ready(function(){
// Floating Labels
//==============================================================
$('[data-toggle="floatLabel"]').attr('data-value', $(this).val()).on('keyup change', function() {
$(this).attr('data-value', $(this).val());
});
});