<cover-view class="dh-box">123</cover-view>
<style lang="scss">
.dh-box{
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 30rpx;
background: #000;
}
</style>
- 发布:2021-11-15 15:27
- 更新:2021-11-15 16:17
- 阅读:970
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows10
HBuilderX类型: 正式
HBuilderX版本号: 3.2.14
手机系统: Android
手机系统版本号: Android 11
手机厂商: OPPO
手机机型: 一加8pro
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
<cover-view class="dh-box">123</cover-view>
<style lang="scss">
.dh-box{
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 30rpx;
background: #000;
}
</style>
<cover-view class="dh-box">123</cover-view>
<style lang="scss">
.dh-box{
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 30rpx;
background: #000;
}
</style>
预期结果:
<cover-view class="dh-box">123</cover-view>
<style lang="scss">
.dh-box{
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 30rpx;
background: #000;
}
</style>
<cover-view class="dh-box">123</cover-view>
<style lang="scss">
.dh-box{
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 30rpx;
background: #000;
}
</style>
实际结果:
<cover-view class="dh-box">123</cover-view>
<style lang="scss">
.dh-box{
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 30rpx;
background: #000;
}
</style>
<cover-view class="dh-box">123</cover-view>
<style lang="scss">
.dh-box{
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 30rpx;
background: #000;
}
</style>
bug描述:
【报Bug】cover-view 在样式position=fixed下,background-color背景样式失效
1 个回复
长方体移动师 - 一个奇葩的程序员
cover-view 不支持的 CSS
注意:nvue的cover-view不在上述限制中,它仅支持且全部支持nvue的所有css