I'm trying to mark up a header, a title for the webpage and a navigation bar as depicted below:
My problem is that they aren't appearing in this order. I can successfully create the header, page title and even the items of the navigation bar. But if I try to create a background for the navigation items by wrapping a div around the navigation items and adding a background color, the box sits on top of the page title such that it looks like this:
How do I get the navigation box to sit where the navigation menu options are (as in the first pic)?
Here's my code:
/* HEADER */
header .headerBox {
background-color: #000000;
width: 100%;
min-height: 50px;
}
.container {
width: auto;
margin-left: 10%;
margin-right: 10%;
}
header .name {
font-family: 'Helvetica', sans-serif;
font-weight: normal;
color: #ffffff;
float: left;
margin-top: 10px;
}
header .account {
font-family: 'Helvetica', sans-serif;
font-weight: normal;
color: #ffffff;
float: right;
margin-top: 10px;
}
/* PAGE TITLE */
.page-title {
width: 100%;
color: #000000;
font-family: 'Helvetica', sans-serif;
font-weight: normal;
text-decoration: none;
font-size: 35px;
float: left;
padding: 0 0 0 0;
margin: 80px 0 80px 0;
}
/* NAVIGATION BAR */
.navigationBox {
background-color: rgba(80, 120, 180);
width: 100%;
height: 32px;
}
.menu-item {
color: #000000;
font-family: 'Helvetica', sans-serif;
font-weight: 300;
text-decoration: none;
font-size: 16px;
float: left;
padding: 0 0 0 0;
margin: 0 120px 0 0;
}
ul {
margin: 0 0 0 0;
padding: 0 0 0 0;
}
li {
display: inline;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
<body>
<!-- HEADER -->
<header>
<div class="headerBox">
<div class="container">
<nav>
<ul>
<li><a href="index.html"><span class="name">Company name</span></a></li>
<li><a href="account.html"><span class="account">Account</span></a></li>
</ul>
</nav>
</div>
</div>
</header>
<!-- PAGE TITLE -->
<div>
<section class="page-title">
<div class="container">
<h1>Page Title</h1>
</div>
</section>
</div>
<!-- NAVIGATION BAR -->
<div class="navigationBox">
<div class="container">
<ul>
<li><a href="menu-option-1.html"><span class="menu-item">Menu Option 1</span></a></li>
<li><a href="menu-option-2.html"><span class="menu-item">Menu Option 2</span></a></li>
</ul>
</div>
</div>
</body>