我有以下我想在 HTML 中实现的用例
I've two div element with background red and blue. The blue div is added later of which a part overlaped with red div.
I have the option of "send to back" which sends the selected div to back of other div.
If I apply this to blue div and select blue div it should look like below image

基本上我正在尝试Arrange --> Order --> Send to back缩小Google Presentation
我确实尝试z-index过,但没有成功。我可以使用background-gradient重叠部分,blue div transparent但这会涉及一些我想避免的计算。
如何在 HTML 中实现这一点?
任何帮助表示赞赏。
注意:所有div元素都放置在position: absolute
Update:上方red div,blue div因为它z-index高于blue div。当red div被选中时,它应该如下所示(突出显示边框)。

现在,如果我选择与blue div它重叠的部分red div不会出现(显然因为它z-index较小),但我希望它border在我 select.it 时出现。