一个 flex 的绝对居中的例子 HTML/CSS

axiuno 3月前 534


html, body {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  background-color: #F7F8FB;
  height: 100%;
  -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; }
.message {
  text-align: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px 20px;
  max-width: 450px; }


最新回复 (3)
  • 天空SKY_317 3月前
    0 引用 2
    官网QQ登陆无法返回???
  • ccc 3月前
    0 引用 3

    但看起来也不像绝对居中啊……
    而且flex在safari还有兼容问题

返回
发新帖
HTTP/1.1 502 Bad Gateway Content-Type: text/html Connection: close Content-Length: 308 Date: Wed, 25 Apr 2018 04:52:48 GMT X-Via: 1.1 localhost.localdomain (random:844266 Fikker/Webcache/3.7.4) 502 Bad Gateway

502 Bad Gateway - Cann't Connect To Upstream Server By SSL Read

Server: localhost.localdomain
Date: 2018-04-25 04:52:48

Fikker/Webcache/3.7.4