<template>
<view class="body">
<view class="feedback">
<view class="type uni-row">
<view class="form-title uni-row">
<text class="label">反馈类型</text><text class="require">*</text>
</view>
<view class="select uni-row">
<text class="select-text">selectType</text>
<!-- <image class="right" src="/static/image/common/mipmap-hdpi/right.png" mode="widthFix"></image> -->
</view>
</view>
<view class="content">
<view class="form-title uni-row">
<text class="label">反馈内容</text><text class="require">*</text>
</view>
<view class="textarea">
<textarea class="text" placeholder="请描述您要反馈的问题" placeholder-class="placeholder"></textarea>
</view>
</view>
</view>
<view class="fixed">
<view class="footer">
<text class="btn">提交</text>
</view>
</view>
</view>
</template>
<style lang="scss">
.body {
flex: 1;
background: #F6F7F8;
.fixed {
width: 750rpx;
height: 104rpx;
background: green;
.footer {
position: fixed;
bottom: 0;
left: 0;
width: 750rpx;
height: 104rpx;
background: blue;
.btn {
margin: 12rpx 30rpx;
width: 690rpx;
height: 80rpx;
background: #FF718D;
border-radius: 40rpx 40rpx 40rpx 40rpx;
text-align: center;
line-height: 80rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 34rpx;
color: #FFFFFF;
}
}
}
}
</style>
以上例子中fixed盒子的子元素footer设置了position: fixed;fixed盒子应该跟在feedback盒子下面,但实际上fixed盒子跑到页面顶端了,如图

m***@163.com (作者)
找到原因了,是全局css内有个fixed设置了position: fixed;导致的样式冲突
2025-11-04 17:09
DCloud_UNI_OttoJi
回复 m***@163.com: 好的,有问题再反馈
2025-11-04 17:34