I want the fixednav div to butt up against the main div Ive tried to add a margin with % and that helps but I would have to use @media to adjust it as the browser shrinks. Is there a way to get this with css only? and not use jscript
#fixednav{
background-color:#00AFEA !important;
border: px solid blue;
min-height:100px;
position: fixed;
top: 0px;
width: 100%;
z-index:1;box-shadow: 0px 0.5px 0px BLACK;
}
.main {
border: px solid blue;
z-index:2;width: 100%;
margin-top: 5%;
}
<div id="fixednav">
nav goes here and z index is 1 and the content is hidden as this div is covering it up
</div><!--fixed nav-->
<!--fixednav should rest against main not behind it-->
<div class="main">
content goes here and z index is 2
</div><!--main-->