div style="width: 300px;height: 200px;position: absolute;left: 50%;top: 30%;margin: -100px 0 0 -150px;
我使用的是把元素装在一个DIV然后设置DIV的CSS属性
left和top是用相对位置让主体在浏览器的中间,然后左移和上移整个界面
div style="width: 300px;height: 200px;position: absolute;left: 50%;top: 30%;margin: -100px 0 0 -150px;
我使用的是把元素装在一个DIV然后设置DIV的CSS属性
left和top是用相对位置让主体在浏览器的中间,然后左移和上移整个界面