Tell us what’s happening:
Describe your issue in detail here.
Hi. Can someone help me out with an issue I am having with my project? I am trying to align the navigation tabs at the top of the page to the right hand side, while still having space between the links. You can look at the code example for the project. I am trying to replicate that format.
Here is a link to my codepen:
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
You can also try flex: 1 0 auto; on your logo id which will make that div grow and push the nav over to the right.
I would also recommend you move the header styling into the CSS so you’re not working between inline styles in your HTML and other things in your CSS to keep it consistent.
Not sure what happened there, worked when I tried it earlier but you already have a good alternative solution .
The flex property is shorthand for flex-grow, flex-shrink and flex-basis.
So flex-grow above 0 (which is the default) allows child items in a flex-box container to expand to take up more space. Whereas flex-shrink is used for how much they can contract. flex-basis is the initial size of something.
With my previous suggestion the idea was you’d want the logo div to take up as much space as possible from left to right (which pushes the nav to to right) and the nav to take up the remaining space. You wouldn’t want the logo’s div to shrink so as to always push the nav over to the right. You’d size the logo itself via the div you created for it.
Small point but if you look just after your image div you will see that you have a div then a nav inside it but the nav is outside the same div at the other end . Clearing these things up may help things to work a little