520BigBear

 

 

 

 

  display: flex;
  align-items: center;  //上下居中
  justify-content: center; //左右居中

 

 很简单,这边小程序为例,  html一样的,   view换成 div其他标签就行

 

.box{
  font-size:32rpx;
  height: 100rpx;

  display: flex;
  align-items: center;  //上下居中
  justify-content: center; //左右居中
}
<view class="box">哈哈哈哈哈</view>
<view class="box">哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈</view>

 参考链接:https://www.jianshu.com/p/c24158006033

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2021-06-03
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-15
  • 2021-12-05
  • 2021-05-23
  • 2022-01-19
  • 2022-12-23
相关资源
相似解决方案