I have the following form to login but they do not line up.
I can not get the user and password span in the same line, that is, there is not a jump between the span
and the input
.
I'm using bootstrap 4.
/* LOGIN */
.login {
background: #D8D8D8;
border-radius: 25px;
padding: 25px;
margin-top: 25px;
display: inline-block;
}
.btn-acceder {
margin-top: 15px;
}
.icon-left {
float: left;
margin-top: 2.5px;
margin-right: 5px;
}
.form-right {
float: right;
}
.checkbox-align {
text-align: right;
color: red;
float: left;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="container">
<div class="login">
<form class="form-signin" method="post">
<h2 class="form-signin-heading">Inicio Sesion</h2>
<div class="col-lg-10" role="form">
<span class="fa fa-user icon-left col-lg-2 control-label"></span>
<input type="text" id="userlogin" name="userlogin" class="form-control form-right" placeholder="Usuario" required autofocus>
</div><br><br>
<div class="col-lg-10" role="form">
<span class="fa fa-unlock-alt icon-left col-lg-2 control-label" aria-hidden="true"></span>
<input type="password" id="passlogin" name="passlogin" class="form-control form-right" placeholder="Contraseña" required>
</div>
<div class="checkbox"><br>
<label>
<input type="checkbox" value="remember-me"> Recordarme
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Acceder</button>
</form>
</div>
</div>
I've tried using float
that the span and the input
are left and right but I can not get them to line up and finally with display: inline-block;
And the other thing is that I can not get the login box to be placed in the center, I've tried with center-block
but it does not go to the center either.
What am I doing wrong?