Live2d Test Env

单行文本溢出居中

想要实现这种,多行溢出默认左对齐 使用flex

.box{
  display: flex;
  align-items: center;
  justify-content: center;
}

假设需求说多行溢出后也要居中对齐 类似这种

只需要在上一段代码中添加text-align:center即可

.box{
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
  
}
posted @ 2022-05-29 11:14  致爱丽丝  阅读(29)  评论(0)    收藏  举报