底部tabbar遮挡页面内容如何解决?

作者站长头像
站长
· 阅读数 10

底部tabbar遮挡页面内容如何解决?tabbar遮挡了部分main底部的内容

.main

.main {
  background-repeat: no-repeat;
  height: 100vh;
  overflow: auto;
  background-size: cover;
  // padding-bottom: 100px;

给 .main 添加padding-bottom 是可以解决的,但是会引发第二个问题就是.main这个容器在滚动的时候 底部滚动的时候需要多滚动几次才能出来,往上滚动的时候也是需要多滚动几次

tabbar样式

.k-tabbar {
  display: flex;
  justify-content: space-around;
  font-size: 12px;
  z-index: 999;
  padding-top: 10px;
  left: 0;
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: $blue;
}
回复
1个回答
avatar
test
2024-06-30
.main {
  height: calc(100vh - 50px);
  overflow: auto;
  
}
回复
likes
适合作为回答的
  • 经过验证的有效解决办法
  • 自己的经验指引,对解决问题有帮助
  • 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
  • 询问内容细节或回复楼层
  • 与题目无关的内容
  • “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容