使用绝对定位,先设置DIV的定位上和左分别为50%,然后使用负边界,边界大小是DIV的高度和宽度的一半
答案补充
代码如下:width:1003px;height:600px; background-color:#000000; position:absolute;
left:50%; top:50%; margin-left:-501.5px; margin-top:-300px
使用绝对定位,先设置DIV的定位上和左分别为50%,然后使用负边界,边界大小是DIV的高度和宽度的一半
答案补充
代码如下:width:1003px;height:600px; background-color:#000000; position:absolute;
left:50%; top:50%; margin-left:-501.5px; margin-top:-300px