CSS绝对定位,相对定位
1、在绝对定位上显示内容(在要显示的内容上面设置相对定位)
<image class="back" src="../../../../1.png"></image>
<view class="name">我是相对定位</view>
page{
background-image: linear-gradient(#94c1f0, #f6f6f7)
}
.back{
width: 100%;
height: 444rpx;
position: absolute;
}
.name{
font-size: 36rpx;
color: white;
font-weight: bold;
text-align: center;
position: relative;
padding: 20rpx 0 20rpx 0;
}
效果: