Why Is My Tooltip Hidden Behind Other Elements?

Tooltip hidden behind elements problems usually happen when the tooltip is clipped by overflow, trapped in a stacking context, placed under a higher z-index element, or positioned relative to the wrong parent.

Tooltip Layer Fix

Why is my tooltip hidden behind other elements?

A tooltip can be coded correctly and still appear behind a card, header, image, dropdown, modal, or nearby section. The problem is rarely the text itself. It is usually a layout-layer problem: overflow:hidden, low z-index, stacking context, transformed parents, or a tooltip that is positioned inside the wrong container.

  • Tooltip z-index
  • Overflow clipping
  • Stacking context
  • Position absolute

What the bug looks like

The tooltip appears cut in half, shows under a card, disappears behind a header, or cannot escape its container.

Why it happens

Tooltips are floating UI, but they are often placed inside normal layout containers that clip or trap them.

What usually fixes it

Remove clipping from the parent, raise the tooltip layer, avoid stacking traps, or render the tooltip in a safer page-level layer.

Error 1

The tooltip is clipped by overflow:hidden

This is one of the most common tooltip bugs. The card needs rounded corners or image cropping, so it uses overflow:hidden. But the tooltip also lives inside that card, so the parent cuts it off.

Broken code

Parent clips tooltip
.card {
  position: relative;
  overflow: hidden;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  z-index: 20;
}

Broken visual result

Tooltip gets cut off
Product card

The tooltip is inside a parent that clips anything outside the card.

Info This tooltip needs to escape the card, but overflow cuts it.
A higher z-index cannot fix clipping caused by parent overflow.

Correct code

Visible floating area
.card {
  position: relative;
  overflow: visible;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  z-index: 20;
}

Fixed visual result

Tooltip can escape
Product card

The tooltip can float outside the card because the parent no longer clips it.

Info This tooltip can now appear above the card.
If the component must crop images, put the cropped image in its own wrapper instead of clipping the whole card.
Error 2

The tooltip has a lower z-index than nearby content

If the tooltip is not clipped but still appears behind another card, header, image, or panel, the problem is layer order. The tooltip needs to be above the nearby interactive content.

Broken code

Low tooltip layer
.tooltip {
  position: absolute;
  z-index: 2;
}

.feature-card {
  position: relative;
  z-index: 10;
}

Broken visual result

Another element paints above it
Pricing option

The tooltip is visible, but another content layer overlaps it.

Info Low z-index tooltip hidden by a card.
Feature card This layer is above the tooltip.
The tooltip is not clipped. It is simply behind a higher layer.

Correct code

Tooltip layer wins
.tooltip {
  position: absolute;
  z-index: 100;
}

.feature-card {
  position: relative;
  z-index: 1;
}

Fixed visual result

Tooltip above nearby content
Pricing option

The tooltip has a deliberate layer above nearby cards.

Info Tooltip layer is now above the card.
Feature card The card no longer covers the tooltip.
Use a controlled z-index scale instead of guessing random numbers.
Error 3

A transformed parent creates a stacking context trap

A tooltip can have z-index:9999 and still lose if it is inside a parent stacking context. Common triggers include transform, filter, opacity, isolation, and positioned parents with z-index.

Broken code

Tooltip trapped
.card {
  transform: translateZ(0);
  z-index: 1;
}

.card .tooltip {
  position: absolute;
  z-index: 9999;
}

Broken visual result

Huge z-index still loses
Transformed card

The tooltip is inside a lower stacking context.

Info Even z-index 9999 cannot escape this parent.
Page layer
z-index only competes inside the stacking context where the element lives.

Correct code

Move tooltip to safe layer
<body>
  <main class="page">...</main>
  <div class="tooltip-layer">...</div>
</body>

Fixed visual result

Tooltip escapes the trap
Transformed card

The component can stay transformed.

Info
Page layer
Tooltip is rendered in a safer page-level layer.
For complex UI, render floating elements in a dedicated layer outside transformed components.
Error 4

The tooltip is positioned relative to the wrong parent

position:absolute uses the nearest positioned ancestor. If the trigger is inside one element but the tooltip is positioned relative to another, the tooltip can appear in the wrong place and hide behind unrelated content.

Broken code

No local anchor
.tooltip-wrap {
  /* missing position: relative */
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
}

Broken visual result

Tooltip floats from wrong place
Tooltip anchored to the wrong ancestor.
Settings row

The trigger is here, but the tooltip is not anchored locally.

Info
Other content The tooltip can collide with this.
The tooltip may look hidden because it is not positioned where you think it is.

Correct code

Local tooltip anchor
.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 100;
}

Fixed visual result

Tooltip anchored correctly
Settings row

The tooltip is positioned relative to the trigger area.

Info Tooltip is anchored to the right local parent.
Other content No longer fighting the tooltip.
Use a local wrapper for simple tooltips and a page-level layer for complex floating UI.
Premium pattern

A production-minded tooltip layer pattern

A stronger tooltip system separates normal layout from floating UI. Simple tooltips can use a local relative wrapper, but complex tooltips should use a dedicated high-level layer so cards, grids, overflow, and transforms do not trap them.

Premium code

Safe tooltip system
:root {
  --layer-tooltip: 1000;
}

.tooltip-anchor {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: var(--layer-tooltip);
  transform: translateX(-50%);
  max-width: min(260px, calc(100vw - 32px));
}

.card-media {
  overflow: hidden;
}

.card-body {
  overflow: visible;
}
/* For complex apps */
.tooltip-layer {
  position: fixed;
  inset: 0;
  z-index: var(--layer-tooltip);
  pointer-events: none;
}

.tooltip-layer .tooltip {
  position: absolute;
  pointer-events: auto;
}

Premium visual result

Floating layer, predictable result
Premium card

The card layout stays clean, and the tooltip has a predictable layer.

Info
Clean tooltip It floats above cards, grids, headers, and nearby sections.
Premium tooltip CSS does not depend on luck. It uses a clear anchor, safe overflow, and a controlled layer.

Fast practical rule

If a tooltip is hidden behind other elements, do not only increase z-index. First check whether the parent is clipping the tooltip with overflow:hidden. Then check stacking context, positioned ancestors, and whether the tooltip should live in a higher page-level layer.

Debug checklist

  • Inspect the tooltip and confirm it has a real position, usually position:absolute or position:fixed.
  • Check the parent container for overflow:hidden, overflow:auto, or overflow:clip.
  • Temporarily set the parent to overflow:visible to see if clipping is the cause.
  • Compare the tooltip z-index with nearby cards, headers, overlays, and dropdowns.
  • Look for stacking context creators like transform, filter, opacity, isolation, and positioned parents.
  • Make sure the tooltip is positioned relative to the intended wrapper.
  • Avoid placing app-level floating UI inside cards, sliders, or overflow-heavy layout wrappers.
  • Use a simple layer scale for tooltip, dropdown, header, modal, and overlay values.
Best first move Toggle parent overflow in DevTools. If the tooltip appears, you found the clipping parent.
Most common cause A card uses overflow:hidden for rounded corners and accidentally clips the tooltip.
Most sneaky cause A transformed parent traps the tooltip in a lower stacking context.
Better mindset Tooltips are floating UI. They should not be trapped by normal content layout.

Final takeaway

A tooltip hidden behind other elements is usually a layer and containment problem, not a text problem. The tooltip may be clipped by overflow, trapped in a stacking context, placed under another z-index layer, or positioned relative to the wrong parent.

Start with overflow, then inspect stacking context, then fix the tooltip’s layer strategy. For simple UI, a local relative wrapper can work. For complex UI, a dedicated tooltip layer is safer and easier to debug.

Want more fixes like this?

Browse more z-index, tooltip, overlay, and CSS debugging guides in the FrontFixer library.

Leave a Comment