css flex布局,小程序flex布局,垂直居中完美解决

css flex布局,小程序flex布局,垂直居中完美解决,第1张

css flex布局,小程序flex布局,垂直居中完美解决

flexd性布局,很好的解决了垂直居中的问题,上代码:

wxml:

<view class='container'>   <view class='item item1'>item1</view>   <view class='item item2'>item2</view>   <view class='item item3'>item3</view> </view> wxss: .container{   width: 100%;   padding-top: 50rpx;   display: flex;   flex-direction: row;   align-items: center;   justify-content: space-between; } .item{   background: darkred;   color: #fff;   width: 150rpx;   text-align: center; } .item1{   height: 100rpx;   line-height: 100rpx; } .item2{   height: 150rpx;   line-height: 150rpx; } .item3{   height: 120rpx;   line-height: 120rpx; } 效果图:

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/587565.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-12
下一篇 2022-04-12

发表评论

登录后才能评论

评论列表(0条)

保存