I am having an issue with my code.
The problem I'm facing is that I am unable to move the green div.free_space
below the other two divs, div.main_pic
and div.navigation
. I don't understand why this is happening. As I am still learning, I would greatly appreciate it if you could point out what went wrong. If there are any mistakes or improvements that can be made, please let me know!
Thank you
Below is the code:
.main_pic {
position: absolute;
height: 600px;
width: 92%;
background: black;
font-size: 20px;
font-family: Century Gothic, Verdana;
font-weight: normal;
left: 4%;
right: 4%;
top: 200px;
}
.navigation {
position: absolute;
height: 50px;
width: 30%;
background: white;
font-size: 15px;
font-family: Century Gothic;
font-weight: normal;
left: 66%;
right: 4%;
top: 100px;
vertical-align: middle;
}
.navigation ul {
text-align: center;
list-style:none;
}
.navigation li {
display: inline;
padding: 2.5%;
}
.navigation li a {
text-decoration:none;
color: #999999;
}
.navigation li a:visited {
color:#4d4d4d;
}
.free_space {
height: 600px;
top: 900px;
width: 100%;
background: green;
}
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="main_pic"></div>
<div class="navigation">
<ul>
<li><a href="#">ITEM</a></li>
<li><a href="#">ITEM</a></li>
<li><a href="#">ITEM</a></li>
<li><a href="#">ITEM</a></li>
</ul>
</div>
<div class="free_space"></div>
</body>
</html>