How to Center Navigation Content and Ensure Background Stretches Full Width on Large Screens?
Hello everyone,
I'm trying to optimize my website's navigation bar for large screens, and I'm facing two issues:
1. The content inside the navigation bar is not centered when the screen width exceeds 800px.
2. The background color of the navigation bar doesn't stretch across the full width of the screen; it stops at 800px.
How can I modify my CSS to ensure the content inside the .max-width container is centered within the 800px limit. Secondly make the background color of the navigation bar extend across the entire width of the screen, while keeping the content centered?
Thank you very much.
Here is my code: https://jsfiddle.net/10moqsLn/20/
Edit fiddle - JSFiddle - Code Playground
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
2 Replies
I’m on the mobile so I can’t test anything or even view your jsfiddle but from what I can see of the code that you have posted, the quickest solution would be to move your max-width and margin declarations to the <ul>
Here is one way to do it