CSS3实现登录窗口水平垂直居中显示

<!DOCTYPE html>
<html>
<head>
<style>
.flex-container {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: DodgerBlue;
    left: 0px;
    top: 0px;
    right: 0px;
    bottom: 0px;
}

#login {
  background-color: #f1f1f1;
  width: 400px;
  height: 280px;
}
</style>
</head>
<body>
<div class="flex-container">
  <div ></div>
</div>

</body>
</html>