question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overlay: highlighted-element and stage-element: z-index in container with fixed position

See original GitHub issue

If I have a div with “position: fixed” as a container and in it an element (e.g. a p element) like <div style="position: fixed; ..."><p id="selector"></p></div> and I try to highlight the p inside the div, then the hightlight-stage will overlay the p (and of course the div). The z-index of the selected element won’t work right, because of the parent-div. You can see a demo at my site (I also included at first normal examples for test reasons) and in the image below.

The only way I found to fix it with dev tools was putting “z-index: 99999999999” in the div, but thats not a really good solution, if there are multiple elements in the div…

grafik

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
dmartenssoncommented, May 31, 2018

For animate mode, could you recursively walk up the element stack and apply an overlay behind every fixed and lift the fixed element above.

That way the element you need would be hoisted so its visible while recursively hide everything else?

0reactions
Naren-hybreedercommented, Mar 17, 2022

@kamranahmedse , I am also getting the same issue, If I use animate version then I am getting the issue, If I use without animate then it’s working. How to use animated version with the above issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create Layout Features with Position and Z-Index in ...
One way to set the placement of an element and how it overlays other elements is with a combination of the position property,...
Read more >
How to Use the Z-index to Overlay Elements With CSS
How do you overlay elements with CSS? The z-index property is used to position elements one above the other and it's really simple...
Read more >
z-index - CSS-Tricks
The z-index property in CSS controls the vertical stacking order of elements that overlap. As in, which one appears as if it is...
Read more >
Everything you want to know about z-index | Medium
In general, an element with a position value other than static (sticky, relative, fixed, absolute) is rendered on top of other statically ...
Read more >
Use CSS and z-index to create a page overlay, then place one ...
Basically I make an overlay div by doing position: fixed; z-index: 100; , and let one element shine through it by giving it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found