Consider a situation like:
<div id="one"/>
<div id="two">
<div id="three"/>
</div>
<div id="four"/>
I'd like to give three a pseudoelement that appears behind it but in front of two (and any other ancestors if there were more). What's complicating this for me is that I'm using a UI framework that generates HTML and CSS so I can't do something specific for this one case -- it must work in general. The framework generates divs that use absolute positioning so assume one, two, and four are absolutely positioned. Three and its pseudoelement could have different position values as long as they behave right.
z-index -1 on the pseudo works great locally, but makes it appear behind two. Okay, create a new stacking context on three by setting its z-index to 0 but that doesn't work right. I think I'm misunderstanding the whole stacking context thing.
If you wonder what I'm really doing, I'm trying to add rounded gradient border support to the framework.