【前端技术训练营】
原理是用绝对定位与z-index配合
wxml
<view class="container" bindtap="to_openvip">
<image class="huiyuan_yingdao" src='/images/me/huiyuan_yingdao.png'></image>
<view class='up'>
我是左边文字
</view>
<view class='right'>
右边文字
</view>
</view>
wxss
.huiyuan_yingdao {
width: 710rpx;
height: 98rpx;
position: absolute;
width: 100%;
}
.container {
width: 100%;
height: 98rpx;
margin: 0;
padding: 0;
position: relative;
}
.up {
position: absolute;
z-index: 1;
color: #963C01;
line-height: 98rpx;
left: 109rpx;
font-size: 30rpx;
font-weight: 400;
}
.right {
position: absolute;
z-index: 1;
color: #fff;
line-height: 98rpx;
right: 51rpx;
font-size: 28rpx;
font-weight: bold;
}