css 登陆页面背景图铺满

.login-page {
  width: 100%;
  position: relative;
  opacity: 1;  //背景透明度 0.8
  min-height: 100vh;
  background-image: url(../assets/loginBG.jpg);
  // background-position: center center;
  background-repeat: no-repeat;
  /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */
  background-attachment: fixed;
  background-size: cover;
  background-color: #464646;
}



//background:rgb(255, 255, 255,0.7); //背景色透明度

//登陆 div 居中   父元素 login-page
.login-box {
  width: 500px;
  height: 500px;
  position: absolute;
  margin: auto;
  top: 0px;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
}

猜你喜欢

转载自blog.csdn.net/Yoga99/article/details/125717937
今日推荐