Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 通过脚本设置表的错误位置_Javascript_Html_Css - Fatal编程技术网

Javascript 通过脚本设置表的错误位置

Javascript 通过脚本设置表的错误位置,javascript,html,css,Javascript,Html,Css,我正在使用下一个CSS: .table { position:static; width: 300px; height: 300px; margin-left: auto; margin-right: auto; left:0; right:0; } 很明显,我在它们属于的地方用过它们。但我在其他页面中也添加了一些脚本: <script language="javascript"> var left = (screen

我正在使用下一个CSS:

.table {
    position:static;
    width: 300px;
    height: 300px;
    margin-left: auto;
    margin-right: auto;
    left:0;
    right:0;
}
很明显,我在它们属于的地方用过它们。但我在其他页面中也添加了一些脚本:

<script language="javascript">
    var left = (screen.width/2)-(300/2);
    var top = (screen.height/2)-(300/2);
    window.open('page.aspx?' + window.location.href.toString().split('?')[1], 'PopUp', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=300, height=300, top=' + top + ', left=' + left);
    window.open('', '_self').close(); 
</script>

左侧变量=(屏幕宽度/2)-(300/2);
变量顶部=(屏幕高度/2)-(300/2);
window.open('page.aspx?'+window.location.href.toString().split('?')[1],'PopUp','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,copyhistory=no,width=300,height=300,top='+top+',left='+left);
window.open('',''self').close();
很多小时以来,我所想要的就是在正确的位置,在顶部和左侧之间没有白线。我不知道我还能做什么


欢迎随时提供帮助。

您所需要的只是另一种风格

html, body {
    margin: 0;
    padding : 0;
}

html,正文{margin:0;padding:0}另请参见:。。。正文上的默认边距为8px。