当前位置:首页 > IT技术 > Web编程 > 正文

CSS3实现登录窗口水平垂直居中显示
2021-10-22 16:59:32

<!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 id="login"></div>
</div>

</body>
</html>

 

本文摘自 :https://www.cnblogs.com/

开通会员,享受整站包年服务立即开通 >