<view class="position-absolute w-100 h-100 bg-white">
<textarea>textarea</textarea>
<button open-type="getUserInfo" >授权登陆</button>
</view>
<view class="w-100 h-100 bg-white">
主界面
<button>button1</button>
</view>
/**index.wxss**/
.position-absolute {
position: absolute;
}
.position-relative {
position: relative;
}
.w-100 {
width: 100%;
}
.h-100 {
height: 100%;
}
.bg-white {
background-color: white;
}
你预期表现是什么?
position-relative
这个没用到,.position-absolute有什么用?
wxml:
<view class="pr">
<view class="pb w-100 h-100 bg-white v1">
<textarea>textarea</textarea>
<button open-type="getUserInfo">授权登陆</button>
</view>
<view class="pb w-100 h-100 bg-white v2">
主界面
<button>button1</button>
</view>
</view>
wxss:
.pr {
position: relative;
}
.pb {
position: absolute;
}
.v1 {
z-index: 1;
}
.v2 {
z-index: 0;
}
.w-100 {
width: 100%;
}
.h-100 {
height: 100vh;
}
.bg-white {
background-color: white;
}
这个可以?