I'm currently working on a fixed navigation panel that sticks in place while scrolling down. Here is the code I have so far:
<header>
<a class="logo" href="/">Logo_name</a>
<nav>
<a href="#">Menu_1</a>
<a href="#">Menu_2</a>
</nav>
<div style="clear: both;"></div>
</header>
Below is the corresponding CSS:
header {
position: fixed;
max-width:960px;
}
.logo {
float: left;
}
nav {
float: right;
}
My goal is to have the logo aligned to the left side and the navigation menus on the right side.
Currently, the floating seems to be working, but the nav elements are appearing right after the logo instead of being floated to the right edge.
When I remove the position:fixed property from the header, the floating works fine. Any suggestions on how to fix this issue would be greatly appreciated!