Well, good morning!
I'm using flexbox, and I saw that to center some div on the screen, div in the case created inside the body, to align with align-items and justify-content (using the two with the value center, will center horizontal and vertical) only works if I leave the html and body tags with 100% height.By default, are these tags tall? Because wide it has 100% looks like.
.flex-box {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.form-group{
display: flex;
flex-direction: column;
}
<!DOCTYPE html>
<html>
<head>
<title>Site Lucas de Carvalho Alves</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
<div class="container-fluid flex-box">
<div class="title-panel">
<h1>Bem vindo!</h1>
</div>
<div class="box-dados">
<form class="form-box-dados" method="POST" action="" name="teste">
<div class="form-group">
<label for="email">Endereço de e-mail</label>
<input type="email" class="form-control" id="email" placeholder="Email" name="email">
<div class="form-group">
<label for="senha">Senha</label>
<input type="password" class="form-control" id="senha" placeholder="Password" name="senha">
</div>
<button class="btn btn-success button-box-dados">Entrar</button>
</form>
</div>
</div>
<script type="text/javascript" src="../_cdn/jquery.js"></script>
</body>
</html>
In the above code, you can check that it only centers horizontally, not vertical, because the html and body are with default height, the only solution is putting the html and height 100%? Or is there some other solution?