【问题标题】:Sticky window bottom div on fixed div固定 div 上的粘性窗口底部 div
【发布时间】:2018-04-19 10:23:01
【问题描述】:

我在移动设备上的粘性 div 有问题。我想在移动菜单中获得粘性窗口 div 效果。所以,黄色的 div 应该覆盖菜单的一部分。我尝试了使用绝对位置和修复的不同解决方案,不幸的是我不想按照自己的方式行事。 My website

粘性 div:

<div class="tag-wrapper">
    <div class="tag">Click here to Refresh</div>
</div>

CSS:

   .tag-wrapper {
     position: absolute;
     top: 0px;
     left: 80px;
   }

   .tag {
     position: fixed;
     background: #ffcc33;
     border: 2px solid #dfa800;
     border-top: 0px;
     padding: 3px 5px;
     bottom: 0;
   }

CSS 我的导航栏:

.side-nav {
  position: fixed;
  width: 260px;
  left: 0;
  top: 0;
  margin: 0;
  -webkit-transform: translateX(-100%);
  -ms-transform: translateX(-100%);
  transform: translateX(-100%);
  height: 100%;
  height: -webkit-calc(100%+ 60px);
  height: calc(100%+ 60px);
  height: -moz-calc(100%);
  padding-bottom: 60px;
  color: #d8d8d8;
  background-color: #23282e;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1040;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-transform: translateX(-105%);
  -ms-transform: translateX(-105%);
  transform: translateX(-105%);
  list-style-type: none;
  padding: 0;
  overflow-x: hidden;
  overflow-y: scroll;}

打开手机外观后,我想要得到的效果是on this page。菜单位于粘性 div 下。 Screen

【问题讨论】:

  • 在那个黄色的 div 中详细解释 粘滞窗口 div 效果,以便我们为您提供帮助。还要添加您希望我们检查的代码部分
  • 当然,我更正了我的描述

标签: html css scroll window sticky


【解决方案1】:

这里固定在菜单底部:

.tag-wrapper {
    height: 100px;
    background-color: white;
    bottom: 0;
    position: absolute;
    width: 100%;
}

白色换成想要的颜色,就是知道在哪里

【讨论】:

  • 不幸的是,这并不能解决我的问题。当我滚动浏览页面底部的菜单时,有可用空间 - div 不会移动。检查屏幕prnt.sc/j7b1pt
  • 很抱歉,您需要在点击手风琴后计算高度。还没有找到方法……还没有
猜你喜欢
  • 1970-01-01
  • 2011-11-03
  • 1970-01-01
  • 2013-12-25
  • 1970-01-01
  • 1970-01-01
  • 2011-10-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多