【问题标题】:Scrollbar thumb is displayed over an absolute div滚动条拇指显示在绝对 div 上
【发布时间】:2019-12-16 00:07:01
【问题描述】:

所以我有这个截图中显示的情况:

点击按钮时会打开一个日历,日历的 div 容器是绝对定位的。但是下面表格的滚动条总是在那个日历的上面,这个日历已经有一个很高的z-index了。

该表已将overflow 设置为auto

我尝试使用一些自定义 CSS 来定位滚动条来操纵 z-index,但这使得整个滚动条消失了:

::-webkit-scrollbar {
     z-index: -1;
} 

还尝试了::-webkit-scrollbar-track::-webkit-scrollbar-thumb,但没有效果。知道我可以尝试什么吗?谢谢。

附:我正在使用带有 Tailwind 的 VueJs。

【问题讨论】:

  • 请分享代码..html和css
  • 请分享代码

标签: html css scrollbar tailwind-css


【解决方案1】:

增加日历的z-index999

.your_calendar_class{
   z-index: 999;
}

【讨论】:

    【解决方案2】:

    您是否尝试过定位日历 div 的父容器?

    【讨论】:

      【解决方案3】:

      添加你的css“位置”标签。

      .your_calendar_class{
         z-index: 999;  
      }
      

      这不起作用。

      使用:

      .your_calendar_class{
         z-index: 999;  
         position:relative;
      }
      
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-03-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-08
        相关资源
        最近更新 更多