Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/389.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.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_Jquery_Html_Css - Fatal编程技术网

从Javascript代码中清除空白的问题

从Javascript代码中清除空白的问题,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我很难在教授的网站上找到一个使用Javascript的div,以便与网站的其他部分保持适当的空间。我尝试过调整边距和其他Stackoverflow.com线程上的一些建议,例如,但似乎都不起作用 基本上,我正试图让链接像其他页面一样在页面上更上层 我得到的是: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.

我很难在教授的网站上找到一个使用Javascript的div,以便与网站的其他部分保持适当的空间。我尝试过调整边距和其他Stackoverflow.com线程上的一些建议,例如,但似乎都不起作用

基本上,我正试图让链接像其他页面一样在页面上更上层

我得到的是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="ecl.css" />
<title>Sarah Lawrence College: Research</title>
<script type="text/javascript">
function hideshow(which){
if (!document.getElementById)
return
if (which.style.display=="block")
which.style.display="none"
else
which.style.display="block"
}
</script>
</head>

<body>
<div id="header"><img src="images/celab-header-reduced.jpg" /></div>
<div id="navigation">
  <ul>
    <li><a href="index.html">About</a></li>
    <li><a href="research.html">Research</a></li>
    <li><a href="teaching.html">Teaching</a></li>
    <li><a href="publications.html">Publications</a></li>
    <li><a href="members.html">Lab Members</a></li>
    <li><a href="contact.html">Contact</a></li>
  </ul>
</div>
  <div id="researchcontent">
    <ul>
      <li>
        <div class="showhide"><a href="javascript:hideshow(document.getElementById('ptsd'))">
          <h1>Posttraumatic Stress Disorder (PTSD)</h1>
          </a></div>
        <div id="ptsd">We are currently a series of studies using cognitive and brain imaging techniques to examine the impact of combat trauma on memory and emotion. These studies focus on how perceptions of one’s self impact cognitive, behavioral, and biological processes associated with recovery from combat trauma.</div>
      </li>

将以下CSS添加到现有样式表的底部。这些样式将使您很容易看到导致不需要的空间的原因

* {
  background: #000 !important;
  color: #0f0 !important;
  outline: solid #f00 1px !important;
 }

然后,使用web浏览器的开发工具相应地调整样式。

也许可以先发送您的页面?听起来您还有其他具有所需格式的页面。如果你有一个已知的好页面,我建议你比较标记和CSS,找出两个页面之间的任何差异,并从中进行更正。也许可以尝试Firebug…?在浏览器开发工具中的任何elment上进行实时更新并不难。请发布一个问题的实时示例,并在需要时用图片更清楚地描述它。此外,我建议您研究CSS网格框架,例如,如果您希望您的站点具有响应性。
/* Structure */

div#content {
    width:600px;
    float:center;
    margin:auto;
}


div#navigation {
    float:left;
    margin:auto auto;
}

div#footer {
    clear:both;
    text-align:center;
    font-size:14px;
    font-family:Times New Roman, Times, serif;
}

div#researchcontent {
    width:600px;
    float:center;
    margin:auto;
}

/* Research */

div.showhide {
    clear:both;
    margin:0px;
}

div#ptsd {
    display:none;
}

div#memory {
    display:none;
}

div#futureself {
    display:none;
}

div#socialremembering {
    display:none;
}

div#trauma {
    display:none;
}
* {
  background: #000 !important;
  color: #0f0 !important;
  outline: solid #f00 1px !important;
 }