父级设置
display: flex;
align-items: center;
justify-content: space-between;
那么第二个数据将居中对齐

如果我们想让他贴左边或者右边的话,我们设置左边一个距离,右边一个auto即可
<view style="padding-left: 30rpx;margin-right: auto;">可预约{{card22.length}}张</view>

本文介绍如何使用CSS Flex布局实现元素的居中对齐及调整。通过display:flex; align-items:center; justify-content:space-between;实现子元素的水平和垂直居中。若需调整位置,可通过设置左右间距来实现。
父级设置
display: flex;
align-items: center;
justify-content: space-between;
那么第二个数据将居中对齐

如果我们想让他贴左边或者右边的话,我们设置左边一个距离,右边一个auto即可
<view style="padding-left: 30rpx;margin-right: auto;">可预约{{card22.length}}张</view>

1638

被折叠的 条评论
为什么被折叠?