Stacking DIVs on top of each other?

前端 未结 9 2290
暗喜
暗喜 2020-12-02 07:59

Is it possible to stack up multiple DIVs like:

&l
9条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-02 08:20

    If you mean by literally putting one on the top of the other, one on the top (Same X, Y positions, but different Z position), try using the z-index CSS attribute. This should work (untested)

    1
    2
    3
    4

    This should show 4 on the top of 3, 3 on the top of 2, and so on. The higher the z-index is, the higher the element is positioned on the z-axis. I hope this helped you :)

提交回复
热议问题