html - 手机上的固定div不固定
问题描述
我需要在屏幕底部固定一个操作栏。
以下 CSS 在桌面模式下运行良好:
<div class="slds-p-around--large actions">
<lightning-button-stateful
label-when-off="Check All"
label-when-on="Uncheck All"
label-when-hover="Uncheck All"
icon-name-when-off="utility:check"
icon-name-when-on="utility:close"
icon-name-when-hover="utility:close"
selected={selected}
onclick={handleMasterSelection}>
</lightning-button-stateful>
<button class="slds-button slds-button--success" onclick={handleApprove}>Approve</button>
<button class="slds-button slds-button--destructive" onclick={showConfirmationModal}>Deny</button>
</div>
.actions{
position: fixed;
bottom: 0;
width: 100%;
background-color: #F3F2F2;
left: 0;
display: block;
height: 8vh;
z-index: 10000;
}
但在移动模式下它不起作用,div 不固定。我必须滚动到页面底部才能看到它。
有什么线索吗?
解决方案
只需更改background-color: #000;
并删除left: 0;
它就可以了。
推荐阅读
- javascript - 如何在 JavaScript 中计算自上午 9:30 以来的时间?
- perforce - 有没有办法在 P4EXP 上关闭“启动时启动”?
- jquery - ajax 调用后如何获取 alert(true)?
- python - 如何允许 Django 容器在没有权限错误的情况下使用 Docker SDK?
- python - 将 json UTC 时间格式转换为 CST - 在 python 中
- django - 如何在 AJAX 中传递 Django url?
- reactjs - Parcel 构建失败`bundle.scss:undefined:undefined: plugin is not a function`
- sql - 如何修复:ORA-01427:单行子查询在 UPDATE 中返回多于一行
- python-3.x - 如果服务器没有在 python3 中以两种方式 SSL 身份验证请求客户端证书,如何停止握手和数据共享?
- html - Chrome 开发工具:检查器显示错误的元素大小?