老版本语法

div{

display: -webkit-box;
-webkit-box-align:center; //垂直居中
-webkit-box-pack:center;//水平居中

}

 

新版本语法

div{

display: -webkit-flex;

-webkit-align-items: center;

align-items: center;//垂直居中

-webkit-justify-content: center;

justify-content: center;//水平居中

}

 

混合版本语法

div{

display: -ms-flexbox; /* 混合版本语法: IE 10 */

 -ms-flex-pack: center; //水平居中

-ms-flex-align: center; //垂直居中

}

 

 

 

相关文章:

  • 2022-12-23
  • 2021-12-22
  • 2021-07-29
  • 2021-05-28
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2021-12-06
  • 2021-12-02
  • 2021-12-31
相关资源
相似解决方案