I want to center the <div="container">
vertically with flexbox, I'm learning it but I can not focus, I'm using the justify-content: center
to adjust it to the center (horizontally) and align-items:center
(To adjust the center vertically), but only I take the justify-content the align-items do not take it.
Html:
<div class="container" style="height: 200px; width: 300px; background: #fff;">
<form action="index_submit" method="get" accept-charset="utf-8">
<input type="text" name="" id="inputuser" placeholder="Username">
<input type="password" name="" id="inputpass" placeholder="Password">
<button class="buton">Log in</button>
</form>
</div>
CSS3
body{
background: #978;
display: flex;
justify-content: center;
align-items: center;
}
.container{
display: flex;
}