Basically, I'm trying to move my hamburger menu div to the right side of the page with Flexbox, but it refuses to budge. I've tried the flex-start/flex-end stuff, I've tried margin-right/left auto, but it doesn't seem to work.
The only thing that makes it work is if I put in a fix left margin, but when the screen size shrinks, it basically pushes the logo off the screen.
What's wrong with my code?
/*Parent Element*/
#nav-bar {
display: flex;
justify-content: space-between;
padding-top: 1rem;
}
/*Children*/
#logo {
flex: 2;
justify-self: flex-start;
max-width: 6em;
margin-right: auto;
}
#mobile-nav {
flex: 1;
justify-self: flex-end;
margin-left: auto;
}
<div id="nav-bar">
<div id="logo"><img src="./img/logo.png" alt=""> </div>
<div id="mobile-nav">
<div></div>
<div></div>
<div></div>
</div>
<ul id="main-nav">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
<li><a href="''" class="btn">CTA</a></li>
</ul>
</div>