Basically I want a fixed navigation that extends the length of the viewport so that that background and border-bottom covers the width of the viewport, but I want the text (the nav links) to remain aligned with the container div that it's inside.
I've tried playing with the margin-left at negative %'s, but while that fixes the navigation across the width of the viewport, the text (nav links) then disappears. How can I get them back into view and containing JUST THE TEXT inside the parent container div? (I really hope that makes sense for someone to understand) Again, I basically just want that border-bottom on the site-nav to run the length of the viewport with the text remaining where it is.
As a side note: this is being designed for a wordpress theme.
.container {
max-width: 928px;
margin: 0 auto;
padding-left: 20px;
padding right: 20px;
overflow: hidden;
}
/*Primary Header Menu*/
.site-header {
margin: 0 auto;
}
.site-header nav {
background-color: #FFF;
position: fixed;
z-index: 99999;
width: 100%;
height: 50px;
top: 0;
padding-top: 15px;
text-transform: uppercase;
font-size: 90%;
border-bottom: 1px solid #393734;
}
.site-header nav ul li {
margin-right: 5px;
position: relative;
width: 150px;
z-index: 1;
}
.site-header nav ul li a:link,
.site-header nav ul li a:visited {
display: block;
padding: 10px 18px;
text-decoration: none;
}
.site-header nav ul li a:hover {
color: #ECECEC;
}
.site-header nav ul li.current-menu-item a:link,
.site-header nav ul li.current-menu-item a:visited,
.site-header nav ul li.current-page-ancestor a:link,
.site-header nav ul li.current-page-ancestor a:visited {
color: #006ec3;
}
/*dropdown menu for subs*/
.site-header nav ul ul {
display: none;
background-color: #FFF;
}
.site-header nav ul li:hover ul{
display: block;
position: absolute;
top: 30px;
padding-left: 0;
}
/*prevents subs from displaying side by side*/
.site-header nav ul ul li,
.site-header ul ul a {
float: none;
}
<body <?php body_class(); ?>>
<div class="container">
<header class="site-header">
<nav class="site-nav">
<?php
$args = array(
'theme_location' => 'primary'
);
?>
<?php wp_nav_menu( $args ); ?>
</nav>
<img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
</header>