how do I center javascript css popup div, no matter what the screen resolution?

后端 未结 7 1318
一生所求
一生所求 2021-02-07 08:14

I have the following code that opens a new popup window while disabling the background, the problem is that I have to position this so that it\'s 100px from the top (already got

7条回答
  •  别那么骄傲
    2021-02-07 09:13

    You need to use these styles to make div center:

    width:500px; 
    left:0;
    right:0;
    margin:0 auto;
    

提交回复
热议问题