div实现水平垂直居中

div实现水平垂直居中

<div class="login-container">
    <div class="login-top-table">
      <div class="login-top-table-cell"> 
        <img src="../../../static/images/login-icon.png" class="login-top-img"/>
        <span class="login-title">页面标题</span>
      </div>
      
    </div>
  </div>

  

.login-container {
  background: url(../../../static/images/login-bg.png) no-repeat;
  background-size: 100% 100%;
  height: calc(100vh);
}

.login-top-table {
  height: calc(30vh);
  display: table;
  width: 100%;
}
.login-top-table-cell {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}

.login-top-img {
  width: 130px;
  display: inline-block;
  vertical-align: middle;
}
.login-title {
  color: #F54427;
    font-size: 50px;
    font-weight: bold;
    margin-left: 20px;
    display: inline-block;
    vertical-align: middle;
}

 

上一篇:内存管理工具,帮助检查内存泄露及野指针问题


下一篇:删除文件夹右键菜单“添加到Windows Media Player 列表”和“使用Windows Media Player播放”