当前位置:网站首页>解决浏览器滚动条导致的页面闪烁问题
解决浏览器滚动条导致的页面闪烁问题
2022-08-01 05:18:00 【集电极】
解决浏览器滚动条导致的页面闪烁问题
说明
我网页初始加载时网页内容没有占满整个高度,后面随着我添加内容,当内容接近浏览器底部时,导致滚动条忽然出现,此时就出现了页面闪烁情况。
css 解决方法
1 方式1
/*方式1 推荐*/
.wrap-outer{
margin-left: calc(100vw - 100%);
}
首先,.wrap-outer指的是居中定宽主体的父级,如果没有,创建一个。
如果是全局滚动条导致的闪烁,也可以尝试设为body
标签,不过要自行测试一下。
如我的body{ margin-left: calc(100vw - 100%); }
2 方式2 给html设置样式
html{
margin-right: calc(100% - 100vw);
overflow-x: hidden;
}
方式2 经过我的测试,浏览器不会出现闪烁了,但会导致我下面的滚动条
不会
出现。
小tip:CSS vw让overflow:auto页面滚动条出现时不跳动 « 张鑫旭-鑫空间-鑫生活 (zhangxinxu.com)
边栏推荐
- PAT乙级 1002 写出这个数
- 移动应用恶意攻击激增500% 三六零天御为APP免费构建安全屏障
- vim配置+ctag像source insight一样方便阅读代码
- High Numbers | 【Re-integration】Line Area Score 880 Examples
- Selenium: element positioning
- Risk strategy important steps of tuning method
- 剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
- Robot_Framework: keyword
- The difference between scheduleWithFixedDelay and scheduleAtFixedRate
- Selenium: Manipulating Cookies
猜你喜欢
程序员代码面试指南 CD15 生成窗口最大值数组
MySQL-数据定义语言-DDLdatebase define language
UE4 rays flashed from mouse position detection
pytorch、tensorflow对比学习—张量
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
Robot_Framework: Assertion
Selenium:弹窗处理
Robot_Framework:常用内置关键字
typescript26 - literal types
可视化全链路日志追踪
随机推荐
Robot_Framework:常用内置关键字
High Numbers | 【Re-integration】Line Area Score 880 Examples
混合型界面:对话式UI的未来
56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
typescript27 - what about enumeration types
(Codeforce 757) E. Bash Plays with Functions
Selenium:浏览器操作
Pyspark Machine Learning: Vectors and Common Operations
(2022牛客多校四)D-Jobs (Easy Version)(三维前缀或)
对话MySQL之父:一个优秀程序员可抵5个普通程序员
Error: AttributeError: module 'matplotlib' has no attribute 'figure'
(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
可持久化线段树
I met a shell script
Selenium: Dropdown Box Actions
2022.7.26 模拟赛
Selenium: JS operation
y83.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十四)
Excuse me, only primary key columns can be queried using sql in table storage. Does ots sql not support non-primary keys?
typescript21 - Comparison of Interfaces and Type Aliases