css 儿童的绝对位置隐藏在固定侧面板中

bt1cpqcv  于 2023-01-10  发布在  其他
关注(0)|答案(1)|浏览(111)

我正在使用TailwindCSS框架的 Jmeter 板,它有固定的(CSS位置)顶部面板,固定的(CSS位置)侧面板和绝对的(CSS位置)主要内容。我在侧面板中有一个工具提示,其悬停效果隐藏在侧面板中。

<script src="https://cdn.tailwindcss.com"></script>

<div class="fixed z-10 h-10 w-full bg-red-500">Top Panel</div>

<div class="h-screen">
  <div class="fixed top-10 z-10 h-full w-3/12 overflow-y-auto border-r-4 border-blue-500 bg-gray-100 pb-64">
    Sidepanel
    <p class="relative flex items-center text-sm font-light text-gray-500 dark:text-gray-400">
      <button data-popover-placement="bottom-end" type="button"><svg class="w-5 h-5 ml-2 text-gray-400 hover:text-gray-500" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg></button></p>
    <div data-popover role="tooltip" class="absolute z-50 w-72 rounded-lg border border-gray-200 bg-white text-sm font-light text-gray-500 shadow-sm transition-opacity duration-300 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400">
      <div class="space-y-2 p-3">
        <p>This is the content of helper tooltip. Testing if the help is completely visible or not. Unfortunately not displaying the help.</p>
      </div>
    </div>
  </div>

  <div class="absolute top-10 left-1/4 z-0 min-h-full w-9/12 overflow-y-auto">Main content</div>
</div>

请注意,我不复制javascript部分,因为我有问题,只有与CSS部分。在我的应用程序中,当鼠标输入问号,助手文本将出现。目前,助手文本(下面的问号)是可见的侧面板宽度,并隐藏超过这一点。我希望这个助手文本是可见的侧面板和主内容(像较高的z索引值的内容)。
感谢您的帮助。如果需要更多的信息,请告诉我。

nbysray5

nbysray51#

你遇到的问题是侧面板(固定位置)阻止了任何溢出。如果你在侧面板上添加overflow: visible,它会起作用。

相关问题