I have this HTML and CSS, I want to know why my left-nav div shows up underneath the content-box div. I would like them to be side by side.
Please don't flame me, I'm sure this is a stupid question but I haven't worked very much in CSS and I'm trying to learn.
@charset "utf-8";
/* CSS Document */
#header {
height: 250px;
width: 728px;
border: dashed #000;
text-align:center;
font-family:Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif;
font-size:12px;
}
#footer {
height: 28px;
width: 728px;
border: dashed #000;
text-align:center;
font-family:Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif;
font-size:12px;
}
#left-nav {
height: 500px;
width: 150px;
border: dashed #000;
text-align: center;
font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif;
font-size: 14px;
position: relative;
}
#content-box {
height: 500px;
width: 578px;
border: dashed #000;
margin-right: 0px;
margin-left: 155px;
margin-top: 0px;
margin-bottom: 0px;
}
.
<body>
<div id="header">
this is the header
</div>
<div id="content-box">
</div>
<div id="left-nav">
<ul id="left-nav-links">
<li> <a href="#"> Link Item #1 </a></li>
<li> <a href="#"> Link Item #2 </a></li>
<li> <a href="#"> Link Item #3 </a></li>
<li> <a href="#"> Link Item #4 </a></li>
<li> <a href="#"> Link Item #5 </a></li>
</ul>
</div>
<div id="footer">
this is the footer
</div>
</body>
</html>