I can not centralize my div in the middle of the page!
I tried to use what they posted in this post , in this other post , in CSS Tricks and in a bunch of other sites on google and I can not centralize the div horizontally.
CSS:
html, body {
height: 100%;
width: 100%;
background-color: red;
}
body {
color: red;
text-align: center;
text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
/*Config da tela do login*/
.login-wrapper {
float: left;
clear: both;
width: 100%;
display: block;
}
.login-container {
float: left;
clear: both;
margin: 0 auto;
}
/*configuração do form login*/
.btn-acessar{
background-color: darkred;
color: white;
width: 75%;
}
.link {
float: left;
clear: both;
width: 100%;
padding: 10px 0;
}
.link a {
display: inline-block;
color: white;
text-decoration: underline;
font-weight: 100;
font-size: 0.8em;
}
.input-login{
width: 75%;
display:block;
margin: 0 auto;
}
form img{
width: 75%;
padding: 0 0 20px;
}
HTML:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Titulo</title>
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css"/>
<link type="text/css" rel="stylesheet" href="css/bootstrap-theme.min.css"/>
<link type="text/css" rel="stylesheet" href="main.css"/>
</head>
<body>
<div class="login-wrapper">
<div class="login-container">
<form>
<img src="img/logo.png" alt="logo">
<div class="form-group">
<input type="email" class="form-control input-login" placeholder="Usuário">
</div>
<div class="form-group">
<input type="password" class="form-control input-login" placeholder="Senha">
</div>
<button type="submit" class="btn btn-acessar">Acessar</button>
</form>
<div class="link">
<a href="#" class="col-xs-6">esqueci minha senha.</a>
<a href="#" class="col-xs-6">seja nosso cliente.</a>
</div>
</div>
</div>
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
To center it vertically I used JQuery, but I did not want to do that to align horizontally, I wanted to be able to align it just with CSS, but I do not know if I pooped somewhere in the code that I could not align with anything I tried. p>
Thanks for the help!