垂直居中方法

文字:line-height=文字外盒子的高度

盒子:

  • 定位:
    • position:absolute
    • top:0;bottom:0;left:0;right:0
    • margin:auto
  • 弹性布局:
    • display:flex
    • justify-content:center
    • align-items:center
posted @ 2023-06-20 09:52  有只小菜猫  阅读(46)  评论(0)    收藏  举报