一个区块不想站在其他区块下

时间:2016-03-12 17:53:58

标签: html css

我尝试制作一个页面,我遇到了块位置的问题。我想将下面的块放在第二个下面,但它仍然位于页面的最顶部:

enter image description here 当我为此块添加边距时,另外两个块随之移动。 这是代码:

body {
  background-color: #14000b;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  padding: 0;
  margin: 0;
}
.header {
  position: relative;
  background-color: #000000;
  float: left;
  width: 100%;
  left: 0;
  top: 0;
  margin: 0 auto;
  height: 80px;
  vertical-align: baseline;
}
#top-image {
  background-image: url(../images/top-image.png);
  height: 69px;
  width: 466px;
  display: block;
  margin: 0 auto;
}
#sub-header {
  position: relative;
  background-color: #161616;
  float: left;
  width: 100%;
  left: 0;
  top: 0;
  height: 60px;
  visibility: inherit;
  vertical-align: baseline;
}
#mid-header {
  margin: 0 0 0 0;
  background-color: #161616;
  height: 60px;
  margin: 0 10% 0 10%;
}
#header-logo {
  height: 80px;
  width: 142px;
  background-image: url(../images/header-logo.png);
  float: left;
  margin-right: 15px;
}
#main-menu {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #161616;
  height: 60px;
}
.top-menu-list {
  float: left;
  height: 60px;
}
.top-menu-list a {
  display: block;
  color: #d6d6d6;
  text-align: center;
  padding: 20px 14px;
  text-decoration: none;
  font-size: 20px;
  height: 60px;
  font-family: Arial, "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, sans-serif;
}
.top-menu-list a:hover {
  background-color: #d62952;
  color: #f8f8f8;
}
#main-block {
  position: relative;
  display: block;
  margin: 0 10%;
  padding: 10px;
  background-color: #303030;
  height: 1100px;
  vertical-align: baseline;
}
#wide-column {
  width: 70%;
  height: 100%;
  background-color: #161616;
}
#footer {
  background-color: #000000;
  float: left;
  min-width: 100%;
  left: 0;
  top: 0;
  margin: 0 auto;
  height: 350px;
}
#mid-footer {
  margin: 0 12% 0 12%;
  background-color: #000000;
  height: 160px;
  padding-top: 20px;
}
#sm-list {
  list-style-type: none;
  margin: 20px 0 20px 0;
  padding: 0;
  overflow: hidden;
}
.sm-button {
  float: left;
  margin-right: 10px;
}
.sm-button a {
  display: block;
  text-decoration: none;
}
#feedback-button {
  width: 150px;
  height: 60px;
  margin-top: 20px;
  background-color: #1a84dd;
}
#feedback-link {
  display: block;
  color: #ffffff;
  text-align: center;
  padding: 19px 14px;
  text-decoration: none;
  font-size: 22px;
  vertical-align: middle;
  height: 60px;
  letter-spacing: 1px;
  font-family: Arial, "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, sans-serif;
}
<div class="header">
  <div id="top-image">

  </div>

</div>

<div id="sub-header">
  <div id="mid-header">

    <div id="header-buttons">
      <ul id="main-menu">
        <li class="top-menu-list"><a href="index.html" class="top-menu-link">HOME</a>
        </li>
        <li class="top-menu-list"><a href="#" class="top-menu-link">LIAPEDIA</a>
        </li>
        <li class="top-menu-list"><a href="#" class="top-menu-link">GUIDES</a>
        </li>
        <li class="top-menu-list"><a href="#" class="top-menu-link">ABOUT</a>
        </li>
      </ul>
    </div>
  </div>
</div>

<div id="main-block">
  <div id="wide-column">

  </div>

  <div id="small-column">

  </div>

</div>

<div id="footer">
  <div id="mid-footer">
    <img src="images/links.png" id="links-label">
    <div id="social-media-buttons">
      <ul id="sm-list">
        <li class="sm-button">
          <a href="http://vk.com/lifeinarena" target="_blank" class="sm-link">
            <img src="images/socvk.png">
          </a>
        </li>
        <li class="sm-button">
          <a href="https://twitter.com/LifeInArena" target="_blank" class="sm-link">
            <img src="images/soctwitter.png">
          </a>
        </li>
        <li class="sm-button">
          <a href="https://www.youtube.com/channel/UCe04DzYZgUIYzwXqZFF1_mA" target="_blank" class="sm-link">
            <img src="images/socyt.png" </a>
        </li>
      </ul>
    </div>
    <img src="images/wanttotelussomething.png" id="feedback-label">
    <div id="feedback-button">
      <a href="#" target="_blank" id="feedback-link">Feedback</a>
    </div>
  </div>
</div>

0 个答案:

没有答案