0
点赞
收藏
分享

微信扫一扫

小程序设置文字水平等距显示

芥子书屋 2022-04-16 阅读 79

在小程序开发用到的文本的两端,需要让这些文字左右对齐 。在模拟器设置的代码

.Text {
  text-align: justify;
  text-justify: distribute-all-lines;
  text-align-last: justify;
}

发现真机模拟显示不正常 再往上找到的 方法 加一个伪元素

.Text {
  text-align: justify;
  text-justify: distribute-all-lines;
  text-align-last: justify;
}
.Text::after{
  content: '';
  width: 100%;
  display: inline-block;
  height: 100%;
  line-height: 0;
}
举报

相关推荐

0 条评论