Navbar not expanding to the full width of the screen
Well hello there, can anyone please tell me how to fix the nav bar?
HTML code for Projects.
CSS:
![](https://utfs.io/f/228250a6-e98c-4d40-a381-5b6b6a59194e-z6115n.jpg)
5 Replies
it's easier to diagnose something like this if you include a codepen so we can see the live code...
but just off the top of my head:
<navbar>
isn't an HTML element, and you've got dangling closing tags for non-existent <li>
tags
The issue is though that you've got side margins that add up to 40% and a width of 65% on the .book-image
classi was typing to slow. What Jochem said ☝️
so that section tries to be 105% width, which is causing scrolling and making it look like the 100% width navbar isn't wide enough
Removed the margins and it worked but I also want it to be on the center
you can have the margins, but
width+left+right
needs to add up to 100%
alternatively, you should be able to set the side margins to both be auto
or use display:flex;
on the parent to center the contents