Navbar Problem

When I click on toggle button, I want the nav items in center, below the logo, how could be done here? https://codepen.io/hamzacodepen951/pen/BavNWKE
14 Replies
Chris Bolson
Chris Bolson•11mo ago
Move the nav to after the div "container" (but still within the header).
Mannix
Mannix•11mo ago
i would wrap the image and the nav together so the nav would be centered to image not page
Hamza Naeem
Hamza Naeem•11mo ago
wrap both in a div but inside a container?
Mannix
Mannix•11mo ago
yup just pack them together
Chris Bolson
Chris Bolson•11mo ago
https://codepen.io/cbolson/pen/poqJepb (note - I updated the header to use grid to be able to ensure that the logo is centered)
Hamza Naeem
Hamza Naeem•11mo ago
This is happening.
No description
Hamza Naeem
Hamza Naeem•11mo ago
I want toogle and icons with logo
Mannix
Mannix•11mo ago
then you need to follow Chris's codepen 😉 @chrisbolson you could have used grid-auto-flow: column; instead of setting up the columns 😉
Chris Bolson
Chris Bolson•11mo ago
I just tried that but it doesn't ensure that the logo is centered, does it?
Mannix
Mannix•11mo ago
ohh i didn't notice that lol
Chris Bolson
Chris Bolson•11mo ago
I changed my pen to use grid-template-columns: repeat(3,1fr);which works just as well
Mannix
Mannix•11mo ago
@chrisbolson I found another solution without touching html you could just tell the nav to sit in the second row and span it across all columns
Chris Bolson
Chris Bolson•11mo ago
yes, true. That makes sense. I actually added the grid code in after I had moved the nav outside of the container for my initial response. but you are right, it could remain where it was.
Hamza Naeem
Hamza Naeem•11mo ago
Hi Mannix and Chris, thank you for your help, I designed it using grid, please check and let me know if there are any problems in it, also it is responsive, and let me know the bad practices that I have used, I took me around 12 hours to make, I knew I take very long,😧 https://codepen.io/hamzacodepen951/pen/bGOdzXY