微信小程序 文字居中
生活随笔
收集整理的這篇文章主要介紹了
微信小程序 文字居中
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1 有寬高 line-height
<view class='container'>666 </view> .container{border: 2rpx black solid;width: 400rpx;height: 200rpx;text-align: center; /* 左右居中 */line-height: 200rpx; /* 設置行高 使文字上下居中 */ }2 使用flex布局
<view class='container'><text>666</text> </view> .container{border: 2rpx solid red;width: 500rpx;height: 200rpx;display: flex;flex-direction: column;justify-content: center;align-items: center; }總結
以上是生活随笔為你收集整理的微信小程序 文字居中的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ubuntu 配置大数据平台hadoop
- 下一篇: 微信小程序 倒计时实现