how to use z-index with relative positioning?

后端 未结 4 1472
感动是毒
感动是毒 2020-12-03 09:57

I have a problem with z-index and my code. I want to have a popup on every row, positioned relative to that row. So I created this code:

4条回答
  •  遥遥无期
    2020-12-03 10:26

    Z-Index is a rule order which results will be visible ONLY when two or more elements overlap. This means that if you want to have same z-index behaviour as in absolute position you'll need to make them overlap. Position relative don't make them overlap, so for example in this example, to make this two divs to overlap, I have to set the second one's top to -50px.

      

提交回复
热议问题