How to make two divs top and bottom

Using <div class="space"></div> before the slider and giving it a height:50px; in css (the same height as the navigation.)

body {margin: 0; padding:0;}
ul {
  background: #000;
  color:#fff;
  line-height:50px;
  margin:0;
  padding:0;
  position: fixed;
  width:100%;
}
ul li {
  display:inline-block;
}
.space {
height:50px;

}
.slider {
  background:red;
  height:350px;
  width:600px;
  margin:0;
}
<ul>
  <li>Home</li>
  <li>About</li>
  <li>Contact</li>
</ul>
<div class="space"></div>
<div class="slider">
</div>

Leave a Comment