So I was creating a page and put an 'h1' tag inside of a full height 'div' tag. Now when I went to add a bit of 'margin-top' to the h1 for some reason it created a white space where the background color should be. Please help. What could be causing this? Here is my code:
body {
margin:0;
padding:0;
font-family: 'Open Sans', sans-serif;
}
#first-div{
height:100vh;
width:100%;
background-color:#E0EBE8;
}
#nav-bar {
background-color:#E0EBE8;
height:58px;
position:fixed;
top:0;
left:0;
width:100%;
}
.menu-link {
float:right;
text-decoration:none;
color:#008080;
font-size:115%;
margin-top:20px;
margin-right:107px;
}
.menu-link2 {
float:right;
text-decoration:none;
color:#008080;
font-size:115%;
margin-top:20px;
margin-right:52px;
}
#second-div {
height:100vh;
}
h1 {
margin-top:100px;
}
<div id="first-div">
<div id="nav-bar">
<a href="#" class="menu-link2">Contact</a>
<a href="#" class="menu-link">Work</a>
<a href="#" class="menu-link">About</a>
</div>
<h1>This is my heading</h1>
</div>
<div id="second-div">
</div>