How to align absolutely positioned element to center?

后端 未结 7 1530
遇见更好的自我
遇见更好的自我 2020-12-22 17:51

I am trying to stack two canvas together and make it a double layers canvas.

I\'ve saw an example here:

&l
7条回答
  •  离开以前
    2020-12-22 18:32

    Move the parent div to the middle with

    left: 50%;
    top: 50%;
    margin-left: -50px;
    

    Move the second layer over the other with

    position: relative;
    left: -100px;
    

提交回复
热议问题