I want to make any elements inside of div to be centered vertically and horizontally.
Here's my HTML :
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
</head>
<body>
<div class="login">
<form action="prosesLogin.php" method="post">
<h1>Login</h1>
<table>
<tbody>
<tr><td>Username</td><td><input type="text" name="username"></td></tr>
<tr><td>Password</td><td><input type="password" name="password"></td></tr>
<tr><td colspan="2" align="right"><input type="submit" value="Login"> <input type="reset" value="Batal"></td></tr>
<tr><td colspan="2" align="center">Belum memiliki akun ? <a href="register.php"><b>Daftar</b></a></td></tr>
</tbody>
</table>
</form>
</div>
</body>
</html>
and this is my CSS :
.login{
height: auto;
margin: 0 auto;
border:1px solid blue;
}
But it doesn't work, please tell how to make it. Thank you.