I want to float my ul to the left and the list items to the right so that they look like this inside a div:
Item 1 Item 2 Item 3
CSS:
.body-nav {
width: 1090px;
margin: 0 auto 0 auto;
background-color: lightblue; }
.body-nav ul {
margin: 0;
padding: 0;
float: left;
list-style: none; }
.body-nav ul li {
float: right;
padding-right: 15px; }
I got the links to look how I want them to look. The problem here is I'm losing my background color. It's like these links are outside of the div.
Here is my HTML:
<header>
<div class="header-content">
<img src="images/logo.png" class="logo" alt="Site Logo">
<ul>
<li>24/7 Support (513) 571-7809</li>
<li><a href="#">Manage my account</a></li>
</ul>
</div>
</header>
<div class="body-nav">
<ul>
<li><a href="#">Web Hosting</a></li>
<li><a href="#">Reseller Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">SSL Certificates</a></li>
</ul>
</div><!--end body div-->