为什么我看不到两个div中的任何输出?

时间:2016-03-22 15:53:31

标签: html css

我无法看到我的左右div中的任何输出。我只能看到页眉和页脚而不是其余的。我是初学者所以请尝试用简单的方式回答。 请尝试指出错误/错误而不是更改代码。



#header {
  height: 50px;
  width: 1600px;
  border: 2px solid red;
  border-radius: 5px;
  background-color: Aquamarine;
  position: fixed;
  z-index: 1;
}
.left {
  height: 500px;
  width: 700px;
  border: 2px solid green;
  border-radius: 5px;
  background-color: Lavenderblush;
  float: left;
}
.right {
  height: 500px;
  width: 700px;
  border: 2px solid blue;
  border-radius: 5px;
  background-color: lightblue;
  float: right;
}
#footer {
  height: 50px;
  width: 1600px;
  border: 2px solid black;
  border-radius: 5px;
  background-color: Yellow;
  clear: both;
}
h1 {
  text-align: center;
  margin: auto;
  color: Blue;
  font-family: Verdana;
}
h4 {
  text-align: center;
  margin: auto;
  color: Blue;
  font-family: Verdana;
}

<div id="header">
  <h1>My Resume</h1>
</div>
<div class="left">
  <p>Hello how are u</p>
</div>
<div class="right">
  <p>some random data here</p>
</div>
<div id="footer">
  <h4>This is the footer</h4>
</div>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:1)

标题为GST_STATE_NULL,因此它被取出正常流程(即它不会影响其外部内容的起始位置),而涵盖内容的顶部紧随其后。

答案 1 :(得分:0)

我还没有加载此代码,但很可能,您的高度为50的固定标题隐藏了您希望看到的文字。您可以添加一个margin-top:50px到.left和.right,以便清除固定的标题。