HTML: How to get a child element to show behind (lower z-index) than its parent
Posted
by dclowd9901
on Stack Overflow
See other posts from Stack Overflow
or by dclowd9901
Published on 2010-03-23T21:19:39Z
Indexed on
2010/03/23
21:33 UTC
Read the original article
Hit count: 261
I need for a certain dynamic element to always appear on top of another element, no matter what order in the DOM tree they are. Is this possible? I've tried z-index
(with position: relative
), and it doesn't seem to work. I hate to be vague, but this is the simplest way I can think of asking this question without explaining its purpose ad nauseum.
So, to recap, I need
<div class="a">
<div class="b"></div>
</div>
<div class="b">
<div class="a"></div>
</div>
To display exactly the same when rendered. And for flexibility purposes (I'm planning on distributing a plugin that needs this functionality), I'd really like to not have to resort to absolute or fixed positioning.
© Stack Overflow or respective owner